我正在尝试将我的 Sphinx 文档与ReadtheDocs链接起来。我可以在本地构建文档,但是当我尝试让ReadtheDocs自动生成文档时,我收到以下错误:
狮身人面像标准错误
Making output directory...
Exception occurred:
File "/var/build/user_builds/mousedb/checkouts/latest/Docs/source/conf.py", line 25, in <module>
from mousedb import settings
ImportError: No module named mousedb
The full traceback has been saved in /tmp/sphinx-err-n_8fkR.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
Either send bugs to the mailing list at <http://groups.google.com/group/sphinx-dev/>,
or report them in the tracker at <http://bitbucket.org/birkenfeld/sphinx/issues/>. Thanks!
我的项目名称是 mousedb。我不明白为什么我在自动构建中收到此导入错误,但在本地却没有。
更新
根据评论,我认为这是将我的设置文件导入同级Docs
目录的问题。settings.py
我应该根据and的位置进行相对导入,而不是进行绝对导入(就像我一直在做的那样)conf.py
。
我想将我的设置文件导入到我conf.py
的目录结构中:
-mousedb
--settings.py
-Docs
--source
---conf.py
--build