【问题标题】:Sphinx automodule not willing to import Translation狮身人面像自动模块不愿意导入翻译
【发布时间】:2012-12-08 00:22:20
【问题描述】:

我偷偷怀疑斯芬克斯不喜欢我的翻译课。当我尝试执行自动方法时:

.. automethod:: translations.models.Translation.new

我收到此警告:

/Users/dash/Projects/zamboni/zamboni/docs/topics/translations.rst:39: 
(WARNING/2) autodoc can't import/find method 
'translations.models.Translation.new', it reported error: "cannot import name
Translation", please check your spelling and sys.path

路径之类的都是正确的。我试过直接在 conf.py 中导入翻译,也有类似的问题。当我尝试类似的方法时,我仍然遇到问题:

from translations.models import Translation as t

它可以导入,但 Translation 中的导入最终导致 Sphinx 返回相同的错误。

有问题的文档在这里:

Zamboni Documentation

【问题讨论】:

    标签: python python-sphinx


    【解决方案1】:

    查看 Zamboni 来源,也许您应该这样做:

    .. automethod:: apps.translations.models.Translation.new
    

    ?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多