擅长:python、mysql、java
<p>我解决了用<code>global-options</code>安装依赖关系的问题,方法是对<code>setuptools.command.install</code>类进行子分类并重写其<code>run()</code>方法,如下面的代码-</p>
<pre><code>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,
},
)
</code></pre>
<p>在这里,我使用全局选项<code>pycurl</code>安装{<cd4>}</p>