【发布时间】:2021-01-24 18:51:16
【问题描述】:
我一直在尝试在 readthedocs 上为我的首个 Python 包 QutiePy 构建文档。在本地构建文档可以正常工作,但是当我尝试在 readthedocs 上构建时,autodoc 无法填充我的部分并给出以下警告:
WARNING: autodoc: failed to import class 'main.register' from module 'QutiePy'; the following exception was raised:
No module named 'QutiePy'
WARNING: autodoc: failed to import module 'gates' from module 'QutiePy'; the following exception was raised:
No module named 'QutiePy'
我已经尝试了许多 conf.py 配置来尝试将我的包添加到 PATH 等,但我尝试过的都没有奏效。
你可以查看我使用的github repohere,我使用的是开发分支。
提前致谢。
更新:我已经发布了 RTD 日志here
更新 2:我已经发布了新的 RTD 日志here
【问题讨论】:
-
我已经将包名更新为全小写,这并没有改变任何东西!
-
在使用 RTD 之前,应该对 RTD 进行 RTD。具体来说,您需要配置 RTD 以在构建其文档之前安装您的包及其任何依赖项。
-
我已经这样做了,将其设置为安装在管理菜单中,并在我的依赖项中包含一个 requirements.txt。
-
检查 RTD 构建日志。 RTD 是否同时安装您的项目及其依赖项?
-
它读取需求文件并说已经安装了依赖项(numpy,scipy)。我在日志中找不到对正在安装的包的任何引用,我现在已将其发布在上述问题中。
标签: python python-sphinx read-the-docs