首页 > 解决方案 > 我在 Read the Docs 上构建项目时遇到问题

问题描述

使用 sphinx-quickstart 创建了 sphinx 项目。运行“make html”并且没有产生错误。将所有代码推送到 GitHub。我尝试在 Read the Docs 上导入和构建项目,但出现以下错误。使用 Mac 时我没有任何问题——它在 Read the Docs 上构建和呈现代码。这次我使用的是 Windows 10。

Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/thirddocs/envs/latest/lib/python3.7/site-packages/sphinx/cmd/build.py", line 304, in build_main
    app.build(args.force_all, filenames)
  File "/home/docs/checkouts/readthedocs.org/user_builds/thirddocs/envs/latest/lib/python3.7/site-packages/sphinx/application.py", line 341, in build
    self.builder.build_update()
  File "/home/docs/checkouts/readthedocs.org/user_builds/thirddocs/envs/latest/lib/python3.7/site-packages/sphinx/builders/__init__.py", line 347, in build_update
    len(to_build))
  File "/home/docs/checkouts/readthedocs.org/user_builds/thirddocs/envs/latest/lib/python3.7/site-packages/sphinx/builders/__init__.py", line 360, in build
    updated_docnames = set(self.read())
  File "/home/docs/checkouts/readthedocs.org/user_builds/thirddocs/envs/latest/lib/python3.7/site-packages/sphinx/builders/__init__.py", line 472, in read
    self.env.doc2path(self.config.master_doc))
sphinx.errors.SphinxError: master file /home/docs/checkouts/readthedocs.org/user_builds/thirddocs/checkouts/latest/contents.rst not found

Sphinx error:
master file /home/docs/checkouts/readthedocs.org/user_builds/thirddocs/checkouts/latest/contents.rst not found

标签: python-sphinxread-the-docs

解决方案


它只需将 master_doc = 'index' 添加到 conf.py 文件中即可。


推荐阅读