当我尝试在Windows下使用Python Sphinx生成html文档时,我收到以下错误:
IOError: [Errno 2] No such file or directory:
'c:\\python27\\sphinx.egg\\sphinx\\pycode\\Grammar.txt'
然而,当我打开sphinx.egg时,文件“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'
任何人都知道为什么?
答案 0 :(得分:2)
我终于找到了为什么它找不到文件“Grammar.txt”。起初,我将sphinx-quickstart.exe移动到我的源文件夹中。相反,从它的默认文件夹中启动sphinx-quickstart.exe然后在问题上更好(也是正确的方法):
&GT;输入文档的根路径。
&GT;文档的根路径[。]:“PathToYourSourceFolder”
您可以在此问题中输入源文件夹路径。
希望这有助于某人!