gpt4 book ai didi

python - 当当前版本满足 setup.py 要求时,为什么要安装新版本的库?

转载 作者:太空宇宙 更新时间:2023-11-03 20:59:53 26 4
gpt4 key购买 nike

我开发了一个使用 matplotlib 的包,因此我将以下行添加到我的项目的 setup.py 中:( link to setup.py )

install_requires=[
'matplotlib>=2.0.0',
...other libs
]

但是,当我尝试将包安装到 virtualenv 中(通过 pip install)时,已经安装了 matplolib 版本 2.1.0,pip 获取并安装了 matplotlib 版本3 无论如何

这是预期的行为还是这里发生了其他事情?

最佳答案

让我尝试使用新的空 virtualenv:

$ pip install matplotlib==2.1.0
Collecting matplotlib==2.1.0
Downloading https://files.pythonhosted.org/packages/6c/90/cf10bb2020d2811da811a49601f6eafcda022c6ccd296fd05aba093dee96/matplotlib-2.1.0.tar.gz (35.7MB)
100% |################################| 35.7MB 412kB/s
Collecting numpy>=1.7.1 (from matplotlib==2.1.0)
Using cached https://files.pythonhosted.org/packages/45/04/7a738e489a25a9638520a43a0cbfcc4be3ed056266e3110a330a905b36b5/numpy-1.16.2-cp35-cp35m-manylinux1_i686.whl
Collecting six>=1.10 (from matplotlib==2.1.0)
Using cached https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl
Collecting python-dateutil>=2.0 (from matplotlib==2.1.0)
Using cached https://files.pythonhosted.org/packages/41/17/c62faccbfbd163c7f57f3844689e3a78bae1f403648a6afb1d0866d87fbb/python_dateutil-2.8.0-py2.py3-none-any.whl
Collecting pytz (from matplotlib==2.1.0)
Downloading https://files.pythonhosted.org/packages/3d/73/fe30c2daaaa0713420d0382b16fbb761409f532c56bdcc514bf7b6262bb6/pytz-2019.1-py2.py3-none-any.whl (510kB)
100% |################################| 512kB 8.4MB/s
Collecting cycler>=0.10 (from matplotlib==2.1.0)
Using cached https://files.pythonhosted.org/packages/f7/d2/e07d3ebb2bd7af696440ce7e754c59dd546ffe1bbe732c8ab68b9c834e61/cycler-0.10.0-py2.py3-none-any.whl
Collecting pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 (from matplotlib==2.1.0)
Downloading https://files.pythonhosted.org/packages/dd/d9/3ec19e966301a6e25769976999bd7bbe552016f0d32b577dc9d63d2e0c49/pyparsing-2.4.0-py2.py3-none-any.whl (62kB)
100% |################################| 71kB 10.8MB/s
Building wheels for collected packages: matplotlib
Building wheel for matplotlib (setup.py) ... done
Stored in directory: /home/phd/.cache/pip/wheels/a7/99/eb/b5566219ff5a526f98e802144d551feaa6b9340b3569bf86df
Successfully built matplotlib
Installing collected packages: numpy, six, python-dateutil, pytz, cycler, pyparsing, matplotlib
Successfully installed cycler-0.10.0 matplotlib-2.1.0 numpy-1.16.2 pyparsing-2.4.0 python-dateutil-2.8.0 pytz-2019.1 six-1.12.0

$ pip install dsutil
Collecting dsutil
Downloading https://files.pythonhosted.org/packages/17/58/ea2ccb9d071040eb5baa16b91327a6799decec6cfbfb12222388e37951d7/dsutil-0.1.1-py3-none-any.whl
Collecting scikit-learn>=0.20.0 (from dsutil)
Downloading https://files.pythonhosted.org/packages/ee/40/d5e691b6f103f5cdfbd2e1468cb172f2267224844330ffe494409ff6a3d5/scikit_learn-0.20.3-cp35-cp35m-manylinux1_i686.whl (4.9MB)
100% |################################| 4.9MB 4.3MB/s
Collecting pandas>=0.20.0 (from dsutil)
Downloading https://files.pythonhosted.org/packages/b1/57/069982c126d22bbdb4de71912eec2c1d8d303149a0d7b17927797479a0ed/pandas-0.24.2-cp35-cp35m-manylinux1_i686.whl (8.7MB)
100% |################################| 8.7MB 3.0MB/s
Requirement already satisfied: matplotlib>=2.0.0 in ./lib/python3.5/site-packages (from dsutil) (2.1.0)
Requirement already satisfied: numpy>=1.8.2 in ./lib/python3.5/site-packages (from scikit-learn>=0.20.0->dsutil) (1.16.2)
Collecting scipy>=0.13.3 (from scikit-learn>=0.20.0->dsutil)
Using cached https://files.pythonhosted.org/packages/19/7b/fdd034bbd1c266b05bc5c38bc91e6733c0e19bc9d3630fd32d869998b6e3/scipy-1.2.1-cp35-cp35m-manylinux1_i686.whl
Requirement already satisfied: python-dateutil>=2.5.0 in ./lib/python3.5/site-packages (from pandas>=0.20.0->dsutil) (2.8.0)
Requirement already satisfied: pytz>=2011k in ./lib/python3.5/site-packages (from pandas>=0.20.0->dsutil) (2019.1)
Requirement already satisfied: cycler>=0.10 in ./lib/python3.5/site-packages (from matplotlib>=2.0.0->dsutil) (0.10.0)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in ./lib/python3.5/site-packages (from matplotlib>=2.0.0->dsutil) (2.4.0)
Requirement already satisfied: six>=1.10 in ./lib/python3.5/site-packages (from matplotlib>=2.0.0->dsutil) (1.12.0)
Installing collected packages: scipy, scikit-learn, pandas, dsutil
Successfully installed dsutil-0.1.1 pandas-0.24.2 scikit-learn-0.20.3 scipy-1.2.1

看到了吗? matplotlib 未升级。 已满足要求:matplotlib>=2.0.0。您能否显示终端的类似输出,以便我们更好地了解发生了什么?

关于python - 当当前版本满足 setup.py 要求时,为什么要安装新版本的库?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55777899/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com