2014-12-05 99 views
2

为什么pip不安装最新?有没有办法强制最新?PIP为什么不升级包装

$ 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... 

注:

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

+0

当一切都失败,时间紧迫,核弹当前安装的软件包。 – smci 2014-12-05 00:50:08

回答

2

如果你看一下pefile1.2.10-1141.2.10-139 - 你会看到一个重要的区别,后者不具备一个“文件”部分的来源和蛋。这意味着,该文件被外部托管,你需要允许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 
+0

非常棒! – shadowbq 2014-12-05 00:56:05