Sphinx 0.6.3:无法找到语言模块

时间:2010-01-01 01:24:44

标签: python python-sphinx

当我尝试使用sphinx-quickstart生成的make.bat命令时收到以下错误消息:

制作HTML

  

错误:找不到语言模块。你是否正确安装了Sphinx及其依赖项?

我尝试运行sphinx-build命令并收到同样的错误。

我在Windows Vista上使用Python 2.6.4。我安装了setuptools-0.6c11.win32-py2.6,并使用easy_install安装了Sphinx 0.6.3。

在尝试导入cmdline时, init .py似乎失败了(我grep'd部分错误消息,并且 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

我没有看到“语言”作为参数传递到哪里,所以我对错误信息感到困惑。我已经找到了一个解决方案,但一无所获。

1 个答案:

答案 0 :(得分:0)

通过sphinx软件包获取“语言”,唯一相关的导入是:

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

所以很可能你的docutils安装有问题。不可否认,如果报告了完整的包路径,则错误消息将更有用。