ReadTheDocs Sphinx 构建因版本错误而失败

问题描述 投票:0回答:1

我已经为去年 12 月发布的 python 库创建了文档。 https://monalysa.readthedocs.io/en/latest/

GitHub 存储库:https://github.com/siva82kb/monalysa/tree/main

我对文档的结构进行了一些更改,但构建现在在 ReadTheDocs 上失败。这似乎是 Sphinx 版本的错误。我在构建步骤中收到以下错误。

Running Sphinx v4.5.0
loading translations [en]... done

Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/monalysa/envs/latest/lib/python3.9/site-packages/sphinx/registry.py", line 438, in load_extension
    metadata = setup(app)
  File "/home/docs/checkouts/readthedocs.org/user_builds/monalysa/envs/latest/lib/python3.9/site-packages/sphinxcontrib/applehelp/__init__.py", line 230, in setup
    app.require_sphinx('5.0')
  File "/home/docs/checkouts/readthedocs.org/user_builds/monalysa/envs/latest/lib/python3.9/site-packages/sphinx/application.py", line 393, in require_sphinx
    raise VersionRequirementError(version)
sphinx.errors.VersionRequirementError: 5.0

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/monalysa/envs/latest/lib/python3.9/site-packages/sphinx/cmd/build.py", line 272, in build_main
    app = Sphinx(args.sourcedir, args.confdir, args.outputdir,
  File "/home/docs/checkouts/readthedocs.org/user_builds/monalysa/envs/latest/lib/python3.9/site-packages/sphinx/application.py", line 219, in __init__
    self.setup_extension(extension)
  File "/home/docs/checkouts/readthedocs.org/user_builds/monalysa/envs/latest/lib/python3.9/site-packages/sphinx/application.py", line 380, in setup_extension
    self.registry.load_extension(self, extname)
  File "/home/docs/checkouts/readthedocs.org/user_builds/monalysa/envs/latest/lib/python3.9/site-packages/sphinx/registry.py", line 441, in load_extension
    raise VersionRequirementError(
sphinx.errors.VersionRequirementError: The sphinxcontrib.applehelp extension used by this project needs at least Sphinx v5.0; it therefore cannot be built with this version.

Sphinx version error:
The sphinxcontrib.applehelp extension used by this project needs at least Sphinx v5.0; it therefore cannot be built with this version.

我尝试将Sphinx的版本强制为5.0.2,将phinxcontrib.applehelp的版本强制为1.0.7,这是在上一个版本的文档中成功运行的版本。

无论我在requirements.txt文件中放置什么版本,我都会得到相同的错误。

做错了什么?我该如何解决这个问题?

python python-sphinx read-the-docs
1个回答
0
投票

您在

root
sphinx==5.0.2 文件中有
requirements.txt

应该移至

docs/requirements.txt

当您这样做时,

sphinxcontrib.applehelp==1.0.7
也应该从root
requirements.txt
中删除。

© www.soinside.com 2019 - 2024. All rights reserved.