为什么PIP没有升级包

时间:2014-12-05 00:35:55

标签: python pip

为什么pip没有安装LATEST?有没有办法强迫LATEST?

$ sudo pip install --upgrade pefile
Requirement already up-to-date: pefile in /usr/local/lib/python2.7/dist-packages
Cleaning up...

$ pip show pefile
---
Name: pefile
Version: 1.2.10-114
Location: /usr/local/lib/python2.7/dist-packages
Requires:

$ pip search "pefile"
pefile                    - Python PE parsing module
  INSTALLED: 1.2.10-114
  LATEST:    1.2.10-139

$ sudo pip install --upgrade --force-reinstall --pre pefile 
Downloading/unpacking pefile
  Downloading pefile-1.2.10-114.tar.gz (49kB): 49kB downloaded
  Running setup.py (path:/tmp/pip_build_root/pefile/setup.py) egg_info for package pefile

Installing collected packages: pefile
  Found existing installation: pefile 1.2.10-114
    Uninstalling pefile:
      Successfully uninstalled pefile
  Running setup.py install for pefile

Successfully installed pefile
Cleaning up...

注意:

$ pip list
pefile (1.2.10-114)
pip (1.5.6)

参考文献: https://code.google.com/p/pefile/

1 个答案:

答案 0 :(得分:2)

如果您查看1.2.10-1141.2.10-139pefile页面,您会看到一个重要的区别,后者没有带有来源的“文件”部分蛋。这意味着文件是在外部托管的,您需要允许pip externalunverified来源安装

pip install pefile --upgrade --allow-external=pefile --allow-unverified=pefile

演示:

$ pip show pefile
---
Name: pefile
Version: 1.2.10-114

$ pip install pefile --upgrade --allow-external=pefile --allow-unverified=pefile
pefile an externally hosted file and may be unreliable
pefile is potentially insecure and unverifiable.
...
Installing collected packages: pefile
  Found existing installation: pefile 1.2.10-114
    Uninstalling pefile:
      Successfully uninstalled pefile
  Running setup.py install for pefile

Successfully installed pefile
Cleaning up...

$ pip show pefile
---
Name: pefile
Version: 1.2.10-139