我的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:但也许有更好的方法来做到这一点.