【发布时间】:2018-01-29 15:24:31
【问题描述】:
在 Read-The-Docs 中运行 autodoc 时,我的项目失败并出现以下错误:
Compiling sources ...error: [Errno 2] No such file or directory: 'gfortran'
我了解到gfortran 在 RTDF 中不可用,所以我想尝试避免在运行 Sphinx 时导致错误的命令 - 类似于
if not 'sphinx' in sys.modules
如this question 建议的那样。
但是,当我想在 RTFD 上构建文档时,仍然会出现错误。我什至评论了包含该命令的整行但没有成功。显然,RTFD 不会使用它应该构建的存储库分支中的当前代码,因为它仍然会从不再在代码中的命令引发错误。我也尝试过擦除版本,但没有帮助。
我真的不知道发生了什么。 RTFD 构建命令是
python3.5 -mvirtualenv --system-site-packages --no-download /home/docs/checkouts/readthedocs.org/user_builds/smuthi/envs/doc
python /home/docs/checkouts/readthedocs.org/user_builds/smuthi/envs/doc/bin/pip install --use-wheel --upgrade --cache-dir /home/docs/checkouts/readthedocs.org/user_builds/smuthi/.cache/pip -I Pygments==2.2.0 setuptools==37.0.0 docutils==0.13.1 mock==1.0.1 pillow==2.6.1 alabaster>=0.7,<0.8,!=0.7.5 commonmark==0.5.4 recommonmark==0.4.0 sphinx==1.6.5 sphinx-rtd-theme<0.3 readthedocs-sphinx-ext<0.6
install --exists-action=w --cache-dir /home/docs/checkouts/readthedocs.org/user_builds/smuthi/.cache/pip -rdocs/requirements.txt
我不知道这是什么意思,但它包含--use-wheel 和cache 等等。我的代码的早期版本确实在 PyPi 上构建了发行版,但当前没有。
这可能是原因吗,即 RTFD 是从 PyPi 安装而不是从 GitLab 存储库安装的,它是否使用旧轮子?
有没有人经历过类似的事情? 有人知道出了什么问题吗?
【问题讨论】:
标签: python python-sphinx read-the-docs