Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 如何让readthedocs.org构建忽略我的requirement.txt?_Python_Windows_Read The Docs_Requirements.txt_Pythonnet - Fatal编程技术网

Python 如何让readthedocs.org构建忽略我的requirement.txt?

Python 如何让readthedocs.org构建忽略我的requirement.txt?,python,windows,read-the-docs,requirements.txt,pythonnet,Python,Windows,Read The Docs,Requirements.txt,Pythonnet,我在github上有一个小应用程序项目,它运行在Windows上,需要pythonnet 我的requirement.txt包含: beautifulsoup4==4.6 pythonnet==2.3 现在我想我应该为它建立一个文档,并把它放在readthedocs.org上。将文档推送到github,并在readthedocs.org上导入项目后,我尝试构建文档,但此操作失败,原因是: Collecting pythonnet==2.3 (from -r /home/docs/checkou

我在github上有一个小应用程序项目,它运行在Windows上,需要
pythonnet

我的
requirement.txt
包含:

beautifulsoup4==4.6
pythonnet==2.3
现在我想我应该为它建立一个文档,并把它放在
readthedocs.org
上。将文档推送到github,并在
readthedocs.org
上导入项目后,我尝试构建文档,但此操作失败,原因是:

Collecting pythonnet==2.3 (from -r /home/docs/checkouts/readthedocs.org/user_builds/trelloradar/checkouts/latest/requirements.txt (line 2))
Using cached pythonnet-2.3.0.tar.gz
Building wheels for collected packages: pythonnet
Running setup.py bdist_wheel for pythonnet: started
Running setup.py bdist_wheel for pythonnet: finished with status 'error'
Complete output from command /home/docs/checkouts/readthedocs.org/user_builds/trelloradar/envs/latest/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-iU2ADR/pythonnet/setup.py';  f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmpnPH_1rpip-wheel- --python-tag cp27:
running bdist_wheel
running build
running build_ext
/bin/sh: 1: mono: not found
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/tmp/pip-build-iU2ADR/pythonnet/setup.py", line 405, in <module>
  zip_safe=False,
  ...
  File "/usr/lib/python2.7/subprocess.py", line 541, in check_call
  raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'mono tools/nuget/nuget.exe update -self' returned non-zero exit status 127 
收集pythonnet==2.3(来自-r/home/docs/checkout/readthedocs.org/user\u builds/trelloradar/checkout/latest/requirements.txt(第2行))
使用缓存的pythonnet-2.3.0.tar.gz
为收集的包构建轮子:pythonnet
为pythonnet运行setup.py bdist_控制盘:已启动
正在运行pythonnet的setup.py bdist_控制盘:已完成,状态为“error”
从command/home/docs/checkout/readthedocs.org/user_builds/trelloradar/envs/latest/bin/python-u-c“导入设置工具,标记化;u-file_uuu=”/tmp/pip-build-iU2ADR/pythonnet/setup.py';f=getattr(标记化,'open',open)(u文件);code=f.read()。替换('\r\n','f.close();exec(编译,'code,'u文件,'exec')”bdist_wheel-d/tmp/tmpnPH_1rpip-wheel----python标记cp27:
运转的车轮
运行构建
运行build_ext
/bin/sh:1:mono:未找到
回溯(最近一次呼叫最后一次):
文件“”,第1行,在
文件“/tmp/pip-build-iU2ADR/pythonnet/setup.py”,第405行,在
zip_safe=False,
...
文件“/usr/lib/python2.7/subprocess.py”,第541行,在check_调用中
引发被调用的进程错误(retcode,cmd)
subprocess.CalledProcessError:命令“mono tools/nuget/nuget.exe update-self”返回非零退出状态127
我知道构建失败是因为它试图在Unix环境中安装.Net材料,即
pythonnet
,但我只想用Sphinx构建文档

我已禁用venv选项:

使用setup.py Install在virtualenv中安装项目


但是我如何告诉readthedocs的构建过程忽略我的
requirement.txt

我通过创建一个
requirements.readthedocs.txt
空文件来解决这个问题,并在“管理”选项卡下的“高级设置”中将构建过程指向它

另外,为了获得
autodoc
导入.Net模块而不抱怨,我将以下内容放入
docs/conf.py

class Mock(MagicMock):
    @classmethod
    def __getattr__(cls, name):
        return MagicMock()

MOCK_MODULES = ['clr', 'System', 'System.Windows.Forms', 'System.Threading']
sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)