【问题标题】:Why does RTD run "python env create" instead of "conda env create" when building?为什么 RTD 在构建时运行“python env create”而不是“conda env create”?
【发布时间】:2021-10-29 20:13:06
【问题描述】:

我正在尝试构建一个关于 ReadTheDocs 的项目。我正在使用一个非常基本的.readthedocs.yaml 文件,内容如下:

# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the version of Python and other tools you might need
build:
  os: ubuntu-20.04
  tools:
    python: "3.9"
    # You can also specify other tool versions:
    # nodejs: "16"
    # rust: "1.55"
    # golang: "1.17"

# Build documentation in the docs/ directory with Sphinx
sphinx:
  builder: html
  configuration: docs/source/conf.py
  fail_on_warning: true

# If using Sphinx, optionally build your docs in additional formats such as PDF
# formats:
#    - pdf

# Optionally declare the Python requirements required to build your docs
python:
   install:
   - requirements: docs/requirements.txt

conda:
  environment: environment.yml

不幸的是,RTD 构建日志似乎告诉我,在克隆并写出 environment.yml 文件后,构建过程运行 python env create --quiet --name develop --file environment.yml。这显然因“没有这样的文件或目录”(错误 2)而失败,因为目录结构中不存在 env 这样的文件或目录。 RTD 不应该在这里运行conda create 吗?如何让它做正确的事?

谢谢, 以利

【问题讨论】:

标签: python read-the-docs


【解决方案1】:

https://github.com/readthedocs/readthedocs.org/issues/8595中描述了这个问题

综上所述,python: "3.9" 现在表示使用 CPython 3.9 + venv,而不管conda.environment

如果要使用 conda 环境,需要指定 python: "miniconda3-4.7"python: "mambaforge-4.10"

将来,至少应该显示更好的错误消息。随意支持这个问题。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-02-20
    • 1970-01-01
    • 2017-07-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-01-22
    相关资源
    最近更新 更多