相关疑难解决方法(0)

setup.py中的install_requires取决于安装的Python版本

我的setup.py看起来像这样:

from distutils.core import setup

setup(
    [...]
    install_requires=['gevent', 'ssl', 'configobj', 'simplejson', 'mechanize'],
    [...]
)
Run Code Online (Sandbox Code Playgroud)

在Python 2.6(或更高版本)下,ssl模块的安装失败:

ValueError: This extension should not be used with Python 2.6 or later (already built in), and has not been tested with Python 2.3.4 or earlier.
Run Code Online (Sandbox Code Playgroud)

是否有标准方法仅为特定的python版本定义依赖项?当然我可以做到,if float(sys.version[:3]) < 2.6:但也许有更好的方法来做到这一点.

python setuptools

8
推荐指数
1
解决办法
4097
查看次数

标签 统计

python ×1

setuptools ×1