我试图用Sphinx来记录一个项目,但遇到了一个问题,即只有一些模块是从文件夹中导入的。我的项目结构如下:
Project
|
|--Main
| |--Scripts
| __init__.py
| libsmop.py
| conv_table.py
| f_discrim.py
| recipes.py
| ...
当我尝试运行make html
时,libsmop
和{conv_table
和{
WARNING: autodoc: failed to import module u'conv_table' from module u'Scripts'; the following exception was raised:No module named conv_table
我不认为这是我的配置文件,因为当我运行sphinx-apidoc -o _rst Main/Scripts
时,它会找到所有的文件,并且我已经确认它们出现在生成的Scripts.rst
文件中。在
为什么autodoc会找到一些模块而不是其他模块?在
编辑:
conv_table.py
的形式是:
您需要根据Sphinx docs检查模块加载路径:
另外,了解脚本目录中的
__init__.py
是什么样子,以及conv_table
模块是什么样子,这也是很有用的。在相关问题 更多 >
编程相关推荐