shadowbq
shadowbq

Reputation: 1459

Why is PIP not upgrading the Package

Why is pip not installing the LATEST? Is there a way to force 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...

Note:

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

References: https://code.google.com/p/pefile/

Upvotes: 3

Views: 4957

Answers (1)

alecxe
alecxe

Reputation: 474221

If you look at the pefile pages for 1.2.10-114 and 1.2.10-139 - you'll see an important difference, the latter doesn't have a "Files" section with a source and egg. That means that the files are hosted externally and you need to allow pip to install from an external and unverified source:

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

Demo:

$ 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

Upvotes: 2

Related Questions