gpt4 book ai didi

python - 阅读文档构建 : cmake/swig are not available

转载 作者:太空宇宙 更新时间:2023-11-04 02:40:13 26 4
gpt4 key购买 nike

为了构建 readthedocs,我需要安装一些要求。这些 pip 要求之一需要 cmake 和 swig 来构建。

在这种情况下是否仍然可以使用 readthedocs?

最佳答案

似乎已经有一个关于此的已归档问题:https://github.com/rtfd/readthedocs.org/issues/2094

它包含一个解决方法:

For anyone else running into this it seems you can also hack around it using the 'READTHEDOCS' env var to conditionally modify install_requires in your setup.py.

这指向:

When RTD builds your project, it sets the READTHEDOCS environment variable to the string True. So within your Sphinx conf.py file, you can vary the behavior based on this. For example:

import os
on_rtd = os.environ.get('READTHEDOCS') == 'True'
if on_rtd:
html_theme = 'default'
else:
html_theme = 'nature'

OTOH,最后一条评论声称它应该适用于当前的 RTD 版本。

关于python - 阅读文档构建 : cmake/swig are not available,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46770089/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com