以库more-itertools为例。它指定了python_requires = >= 3.4,表示它与以前的版本不兼容。
当我尝试在一个全新的virtualenv (pip==19.2.3,setuptools==41.2.0)中使用pip install more-itertools时,我得到了以下错误:ERROR: Package 'more-itertools' requires a different Python: 2.7.10 not in '>=3.4'
我的问题是:如何让pip安装兼容的早期版本?这是可能的吗,或者我必须将我的依赖项固定到以前的版本?
我在pip install --help中看不到任何在这里特别有用的东西。
发布于 2019-08-27 07:24:12
好了,现在我更困惑了。
在一个新的docker上尝试一下,它似乎开箱即用:
from centos:centos7
RUN yum install -y epel-release
RUN yum install -y python-pip
RUN python -m pip install -U virtualenv pip
RUN mkdir /test
WORKDIR /test
RUN virtualenv venv
ENV PATH="/test/venv/bin:$PATH"
RUN pip install more-itertools这将安装more-itertools==5.0.0
Edit:事实证明,这是我使用的索引服务器的问题,它在安装时不能正确地传递python_requires元数据。
https://stackoverflow.com/questions/57664702
复制相似问题