【问题标题】:How do I tell readthedocs which requirements file to load ?如何告诉 readthedocs 加载哪个需求文件?
【发布时间】:2018-03-13 05:25:34
【问题描述】:

我的 readthedocs.org 构建刚刚开始失败......我不确定为什么确切而且不是特别擅长 Sphynx。我不明白为什么它试图为 docs 目录之外的需求文件构建东西,或者为什么它突然找不到这个版本的 Django(或者为什么它甚至需要)。

失败消息

Collecting Django==2.0.3 (from -r /home/docs/checkouts/readthedocs.org/user_builds/django-hitcount/checkouts/latest/example_project/requirements.txt (line 1))
  Could not find a version that satisfies the requirement Django==2.0.3 (from -r /home/docs/checkouts/readthedocs.org/user_builds/django-hitcount/checkouts/latest/example_project/requirements.txt (line 1)) (from versions: 1.1.3, ...1.11.11)
No matching distribution found for Django==2.0.3 (from -r /home/docs/checkouts/readthedocs.org/user_builds/django-hitcount/checkouts/latest/example_project/requirements.txt (line 1))

回购

这是给:https://github.com/thornomad/django-hitcount

如果你想看看我把这件事搞砸的方式!谢谢

【问题讨论】:

  • 您可以使用此选项在.readthedocs.yml 文件中指定requirements.txt 文件:requirements_file: path/to/requirements.txt

标签: python-sphinx read-the-docs


【解决方案1】:

根据log file,RTD 正在您的项目根目录解析您的requirements.txt,这反过来又调用其他三个requirements.txt 文件并在latest/example_project/requirements.txt 中的一个(配置为您的@ 987654326@分公司)。您可以在项目的admin 中配置 RTD 应使用的 requirements.txt 文件。

先试一试,然后再报告。

否则,您的 requirements.txt 文件之间可能存在依赖项版本冲突。

【讨论】:

  • 我什至浏览了设置,但显然我看得太快了。谢谢!这很有效,现在正在成功构建。
  • 或者,您可以在 .readthedocs.yml 文件中指定 requirements.txt 文件,其中包含以下行:requirements_file: path/to/requirements.txt
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2022-01-22
  • 2011-03-13
  • 1970-01-01
  • 1970-01-01
  • 2021-12-26
  • 1970-01-01
相关资源
最近更新 更多