2024-06-26 00:24:34 发布
网友
我需要通过在设置.py. 在
rjsmin提供了一种通过使用--without-c-extensions开关禁用c扩展的方法,如下所示
rjsmin
--without-c-extensions
python setup.py install --without-c-extensions
我想知道,如何将这个开关添加到install_require字符串中。在
install_require
您需要在需求文本中提供 install-option或 global-option。在
install-option
global-option
你可以参考doc here
我解决了用global-options安装依赖关系的问题,方法是对setuptools.command.install类进行子分类并重写其run()方法,如下面的代码-
global-options
setuptools.command.install
run()
from setuptools import setup from setuptools.command.install import install from subprocess import call class CustomInstall(install): def run(self): install.run(self) call(['pip', 'install', 'pycurl', ' global-option= with-nss']) setup( ... cmdclass={ 'install': CustomInstall, }, )
在这里,我使用全局选项pycurl安装{}
pycurl
您需要在需求文本中提供
install-option
或global-option
。在你可以参考doc here
我解决了用
global-options
安装依赖关系的问题,方法是对setuptools.command.install
类进行子分类并重写其run()
方法,如下面的代码-在这里,我使用全局选项}
pycurl
安装{相关问题 更多 >
编程相关推荐