2012-07-25 97 views
2

找到「Grammar.txt」當我試圖生成使用Python獅身人面像Windows下的HTML文檔,我得到以下錯誤:不能在python-獅身人面像

IOError: [Errno 2] No such file or directory: 
'c:\\python27\\sphinx.egg\\sphinx\\pycode\\Grammar.txt' 

然而,當我打開獅身人面像。雞蛋,文件「Grammar.txt」存在......

下面是它提供

# Sphinx version: 1.1.3 
# Python version: 2.7.3 
# Docutils version: 0.9.1 release 
# Jinja2 version: 2.6 Traceback (most recent call last): 
File "c:\python27\sphinx.egg\sphinx\cmdline.py", line 188, in main 
    warningiserror, tags) 
File "c:\python27\sphinx.egg\sphinx\application.py", line 114, in __init__ 
    self.setup_extension(extension) 
File "c:\python27\sphinx.egg\sphinx\application.py", line 247, in 
setup_extension 
    mod = __import__(extension, None, None, ['setup']) 
File "c:\python27\sphinx.egg\sphinx\ext\autodoc.py", line 26, in <module> 
File "c:\python27\sphinx.egg\sphinx\pycode\__init__.py", line 25, in <module> 
File "c:\python27\sphinx.egg\sphinx\pycode\pgen2\driver.py", line 126, in load_grammar 
    g = pgen.generate_grammar(gt) 
File "c:\python27\sphinx.egg\sphinx\pycode\pgen2\pgen.py", line 383, in generate_grammar 
    p = ParserGenerator(filename) 
File "c:\python27\sphinx.egg\sphinx\pycode\pgen2\pgen.py", line 15, in __init__ 
    stream = open(filename) IOError: [Errno 2] No such file or directory: 'c:\\python27\\sphinx.egg\\sphinx\\pycode\\Grammar.txt' 

任何人有一個線索,爲什麼日誌?

回答

2

我終於發現它爲什麼沒有找到文件「Grammar.txt」。起初,我將sphinx-quickstart.exe移到我的源文件夾中。相反,它是更好的(也是正確的方式做),只是從它的默認文件夾啓動獅身人面像,quickstart.exe,然後在這個問題:

> Enter the root path for documentation.

> Root path for the documentation [.]: "PathToYourSourceFolder"

您在這個問題進入你的源文件夾路徑。

希望這可以幫助別人!