问题描述
我有一个带有 setup.py
脚本的 python 包,其依赖关系如下:
install_requires=[
'matplotlib<3','numpy>=1.14,<2','Jinja2>=2,<3','pandas>=0.22,<1','biopython>=1.72,!=1.74,<1.78','argcomplete',],python_requires='>3.4,<4',
尝试运行 python3 setup.py install --user
时出现错误
RuntimeError: Python version >= 3.7 required.
这来自
Searching for numpy<2,>=1.14
Reading https://pypi.python.org/simple/numpy/
Downloading https://files.pythonhosted.org/packages/d2/48/f445be426ccd9b2fb64155ac6730c7212358882e589cd3717477d739d9ff/numpy-1.20.1.zip#sha256=3bc63486a870294683980d76ec1e3efc786295ae00128f9ea38e2c6e74d5a60a
Best match: numpy 1.20.1
Processing numpy-1.20.1.zip
Writing /tmp/easy_install-u_dzcets/numpy-1.20.1/setup.cfg
Running numpy-1.20.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-u_dzcets/numpy-1.20.1/egg-dist-tmp-dfrul5ce
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/setuptools/sandBox.py",line 154,in save_modules
yield saved
File "/usr/lib/python3/dist-packages/setuptools/sandBox.py",line 195,in setup_context
yield
File "/usr/lib/python3/dist-packages/setuptools/sandBox.py",line 250,in run_setup
_execfile(setup_script,ns)
File "/usr/lib/python3/dist-packages/setuptools/sandBox.py",line 45,in _execfile
exec(code,globals,locals)
File "/tmp/easy_install-u_dzcets/numpy-1.20.1/setup.py",line 30,in <module>
'matplotlib<3',RuntimeError: Python version >= 3.7 required.
我正在使用 python 3.6.9
和 pip 21.0.1
在干净的测试机器上进行安装。
现在我知道,我可以通过将 numpy 限制为例如来为 python 3.6 解决这个问题<1.19
(然后使用 1.18.5
),但我无法理解 setuptools
解析为与目标(已安装)python 不兼容的 numpy 版本这一事实。
所以我的问题是如何告诉 setuptools
在 install_requires
中指定的所有包应该与使用的 python 进一步版本兼容?
是否应该为不同的python版本编写多个依赖规范,而不是依赖setuptools的依赖解析?
感谢您的任何意见
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)