【发布时间】:2018-04-16 07:52:31
【问题描述】:
我有一个依赖于 subprocess32 的库 (subx)。 subprocess32 库是 Python2.7 的反向端口,并提供超时 kwarg。
我的库需要 timeout kwarg。
仅当目标平台是 Python2.x 时,我才需要 subprocess32。
我应该如何在我的项目中定义依赖关系?
如果我通过“install_requires”(setup.py) 定义对 subprocess32 的依赖并且我在 python3 virtualenv 中,我会收到此错误消息:
===> pip install -e git+https://github.com/guettli/subx.git#egg=subx
Obtaining subx from git+https://github.com/guettli/subx.git#egg=subx
Cloning https://github.com/guettli/subx.git to ./src/subx
Collecting subprocess32 (from subx)
Using cached subprocess32-3.2.7.tar.gz
Complete output from command python setup.py egg_info:
This backport is for Python 2.x only.
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-lju3nl1y/subprocess32/
【问题讨论】:
标签: python pip dependency-management setup.py install-requires