سؤال

أتلقى رسالة الخطأ التالية عندما أحاول استخدام أمر Make.Bat الذي تم إنشاؤه.

جعل HTML

خطأ: لا يمكن العثور على وحدة اللغات. هل قمت بتثبيت أبو الهول وتبعياته بشكل صحيح؟

حاولت تشغيل الأمر sphinx-build وحصلت على نفس الخطأ.

أنا أستخدم Python 2.6.4 على Windows Vista. لقد قمت بتثبيت setuptools-0.6c11.win32-py2.6 ، وقمت بتثبيت sphinx 0.6.3 باستخدام easy_install.

يبدو أنه فيه.py يفشل عندما يحاول استيراد CMDLine (أنا جزء من رسالة الخطأ ، و فيهكان .py هو الملف الوحيد الذي ظهر) لأن الخطأ يظهر في try كتلة التي تستورد CMDLINE.

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

لا أرى أين سيتم تمرير "اللغات" كحجة ، لذلك أشعر بالارتباك في رسالة الخطأ. لقد بحثت عن حل ، لكنني لم أظهر شيئًا.

هل كانت مفيدة؟

المحلول

من خلال حزمة sphinx لـ "اللغات" ، فإن الاستيراد الوحيد ذو الصلة هو:

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

على الأرجح أن هناك شيئًا خاطئًا في تثبيت DocUtils. من المسلم به أن رسالة الخطأ ستكون أكثر فائدة إذا تم الإبلاغ عن مسار الحزمة الكامل.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top