簡體   English   中英

當前庫滿足setup.py要求時,為什么要安裝新版本的庫?

[英]Why did a new version of a library get installed when the current one satisfied setup.py requirements?

我開發了一個使用matplotlib的軟件包,因此已將以下行添加到項目的setup.py :( 鏈接到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 您可以顯示終端的類似輸出,以便我們更好地了解發生了什么嗎?

由於您將版本指定為> = 2.0.0 (大於2.xx) ,因此pip正在安裝最新版本3.xx。

如果要安裝版本2.0.0,請嘗試使用以下代碼:

install_requires=[
    'matplotlib==2.0.0'
]

鏈接以獲取有關版本控制的更多信息。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM