我对狮身人面像还不熟悉,需要帮助来找出我为什么会出现以下错误:
WARNING: autodoc: failed to import module 'employe_dao' from module 'models'; the following exception was raised:
No module named 'models'
我的项目结构是:
|
|
|
|
|
|
|
|
|
|
|
|
|
...
|
|
|
enter code here
...
这是个狙击手
index.rst
...
.. toctree::
:maxdepth: 2
:caption: Contents:
.. automodule::src
:members:
:undoc-members:
:show-inheritance:
.. automodule::models
:members:
:undoc-members:
:show-inheritance:
...
* :ref:`modindex`
我补充说
sys.path.insert(0, os.path.abspath('./sub_project'))
和取消注释
import os, import sys
在里面
conf.py
如中所述
Sphinx: autodoc can`t import module
sphinx-build fail - autodoc can't import/find module
@Ryandillan建议添加
sys.path.insert(0, os.path.abspath('..'))
到
config.py
修正了我的
404“找不到索引”
误差为
model index
对于
索引索引
我补充说
extensions = ['sphinx.ext.autodoc']
到
组态软件
在另一个stackoverflow线程中推荐。
有什么我做错的建议吗?