在python-sphinx中找不到"Grammar.txt" [英] Cannot find "Grammar.txt" in python-sphinx

查看:25
本文介绍了在python-sphinx中找不到"Grammar.txt"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在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:python27sphinx.eggsphinxcmdline.py", line 188, in main
    warningiserror, tags)   
File "c:python27sphinx.eggsphinxapplication.py", line 114, in __init__
    self.setup_extension(extension)
File "c:python27sphinx.eggsphinxapplication.py", line 247, in
setup_extension
    mod = __import__(extension, None, None, ['setup'])
File "c:python27sphinx.eggsphinxextautodoc.py", line 26, in <module>  
File "c:python27sphinx.eggsphinxpycode\__init__.py", line 25, in <module>
File "c:python27sphinx.eggsphinxpycodepgen2driver.py", line 126, in load_grammar
    g = pgen.generate_grammar(gt)
File "c:python27sphinx.eggsphinxpycodepgen2pgen.py", line 383, in generate_grammar
    p = ParserGenerator(filename)
File "c:python27sphinx.eggsphinxpycodepgen2pgen.py", line 15, in  __init__
    stream = open(filename) IOError: [Errno 2] No such file or directory: 'c:\python27\sphinx.egg\sphinx\pycode\Grammar.txt'

有人知道为什么吗?

推荐答案

我终于找到了为什么找不到文件&Grammar.txt&。首先,我将sphinx-ickstart.exe移到了我的源文件夹中。相反,更好的方法(也是正确的做法)是从它的默认文件夹启动sphinx-ickstart.exe,然后出现以下问题:

&>输入文档的根路径。

&>文档的根路径[.]:";Path ToYourSourceFold";

在此问题中输入您的源文件夹路径。

希望这能帮助某人!

这篇关于在python-sphinx中找不到&quot;Grammar.txt&quot;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆