简体   繁体   English

Sphinx 0.6.3:找不到语言模块

[英]Sphinx 0.6.3: The languages module cannot be found

I receive the following error message when I try to use the sphinx-quickstart generated make.bat command: 当我尝试使用sphinx-quickstart生成的make.bat命令时,收到以下错误消息:

make html 使HTML

Error: The languages module cannot be found. 错误:找不到语言模块。 Did you install Sphinx and its dependencies correctly? 您是否正确安装了Sphinx及其依赖项?

I tried running the sphinx-build command and received the same error. 我尝试运行sphinx-build命令并收到相同的错误。

I am using Python 2.6.4 on Windows Vista. 我在Windows Vista上使用Python 2.6.4。 I have installed setuptools-0.6c11.win32-py2.6, and installed Sphinx 0.6.3 using easy_install. 我已经安装了setuptools-0.6c11.win32-py2.6,并使用easy_install安装了Sphinx 0.6.3。

It appears that init .py is failing when it tries to import cmdline (I grep'd part of the error message, and init .py was the only file that turned up) since the error shows up in the try block that imports cmdline. 似乎init .py在尝试导入cmdline时失败(我在错误消息中做了一部分,并且init .py是打开的唯一文件),因为该错误显示在导入cmdline的try块中。

try:
    from sphinx import cmdline
except ImportError, err:
    errstr = str(err)
    if errstr.lower().startswith('no module named'):
        whichmod = errstr[16:]
        hint = ''
        if whichmod.startswith('docutils'):
            whichmod = 'Docutils library'
        elif whichmod.startswith('jinja'):
            whichmod = 'Jinja library'
        elif whichmod == 'roman':
            whichmod = 'roman module (which is distributed with Docutils)'
            hint = ('This can happen if you upgraded docutils using\n'
                    'easy_install without uninstalling the old version'
                    'first.')
        else:
            whichmod += ' module'
        print >>sys.stderr, ('Error: The %s cannot be found. '
                             'Did you install Sphinx and its dependencies '
                             'correctly?' % whichmod)
        if hint:
            print >> sys.stderr, hint
        return 1
    raise

I do not see where "languages" would get passed as an argument, so I am confused at the error message. 我看不到“语言”将在哪里作为参数传递,因此我对错误消息感到困惑。 I have searched for a solution, but have turned up nothing. 我一直在寻找解决方案,但没有发现任何问题。

Grepping through the sphinx package for "languages", the only relevant import is: 在sphinx包中查找“语言”,唯一相关的导入是:

/usr/lib/pymodules/python2.5/sphinx/environment.py:from docutils.parsers.rst.languages import en as english

So most likely there's something wrong with your docutils installation. 所以很可能您的docutils安装有问题。 Admittedly, the error message would be more helpful if the full package path was reported. 诚然,如果报告了完整的程序包路径,该错误消息将更有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM