【发布时间】:2011-08-30 03:41:42
【问题描述】:
我的 setup.py 看起来像这样:
from distutils.core import setup
setup(
[...]
install_requires=['gevent', 'ssl', 'configobj', 'simplejson', 'mechanize'],
[...]
)
在 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.
是否有一种标准方法可以仅为特定 python 版本定义依赖关系?当然我可以使用if float(sys.version[:3]) < 2.6: 来做到这一点,但也许有更好的方法来做到这一点。
【问题讨论】:
-
我找不到 install_requires 作为 distutils.core.setup 的参数,它似乎是 setuptools 遗留下来的。 docs.python.org/2/distutils/apiref.html#distutils.core.setup
标签: python setuptools