Sphinx 在构建 readthedocs 项目时找不到 linuxdoc



我正在使用readthedocs创建一些文档。我可以在本地创建html文件,当我用浏览器打开html文件时,文档看起来就像我想要的那样。因此,我将源代码推送到github并尝试在那里构建项目-但失败了,出现以下错误:

Running Sphinx v4.1.2
loading translations [en]... done
Traceback (most recent call last):
File "/home/docs/checkouts/readthedocs.org/user_builds/compas-docs-readthedocs/envs/latest/lib/python3.7/site-packages/sphinx/registry.py", line 429, in load_extension
mod = import_module(extname)
File "/home/docs/checkouts/readthedocs.org/user_builds/compas-docs-readthedocs/envs/latest/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'linuxdoc'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/docs/checkouts/readthedocs.org/user_builds/compas-docs-readthedocs/envs/latest/lib/python3.7/site-packages/sphinx/cmd/build.py", line 279, in build_main
args.tags, args.verbosity, args.jobs, args.keep_going)
File "/home/docs/checkouts/readthedocs.org/user_builds/compas-docs-readthedocs/envs/latest/lib/python3.7/site-packages/sphinx/application.py", line 237, in __init__
self.setup_extension(extension)
File "/home/docs/checkouts/readthedocs.org/user_builds/compas-docs-readthedocs/envs/latest/lib/python3.7/site-packages/sphinx/application.py", line 393, in setup_extension
self.registry.load_extension(self, extname)
File "/home/docs/checkouts/readthedocs.org/user_builds/compas-docs-readthedocs/envs/latest/lib/python3.7/site-packages/sphinx/registry.py", line 433, in load_extension
err) from err
sphinx.errors.ExtensionError: Could not import extension linuxdoc.rstFlatTable (exception: No module named 'linuxdoc')
Extension error:
Could not import extension linuxdoc.rstFlatTable (exception: No module named 'linuxdoc')

我正在使用linuxdoc。rstFlatTable模块。我已经在本地安装了linuxdoc,正如我所提到的,html文件的本地构建工作得很好,并且平面表格看起来像它们应该的那样。但是readthedocs的构建失败了。

我怀疑我可能需要在conf.py中设置路径为linuxdoc,但我不知道路径是什么。

我安装了linuxdoc:

pip install git+http://github.com/return42/linuxdoc.git

我找不到它的安装位置。如有任何指导,将不胜感激。

这样的依赖必须显式地添加到您的requirements.txt文件中,

https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html使用配置文件

# File: docs/requirements.txt
# Defining the exact version will make sure things don't break
sphinx==3.4.3
sphinx_rtd_theme==0.5.1
readthedocs-sphinx-search==0.1.0
linuxdoc==20210324

最新更新