question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

pip fail after upgrade to 1.5.5

See original GitHub issue
$ pip install --upgrade pip
Downloading/unpacking pip from https://pypi.python.org/packages/py2.py3/p/pip/pip-1.5.5-py2.py3-none-any.whl#md5=03a932d6f82a3887d8de1cdb837c87ed
  Using download cache from /Users/robinho/Library/Caches/pip-downloads/https%3A%2F%2Fpypi.python.org%2Fpackages%2Fpy2.py3%2Fp%2Fpip%2Fpip-1.5.5-py2.py3-none-any.whl
Installing collected packages: pip
  Found existing installation: pip 1.5.4
    Uninstalling pip:
      Successfully uninstalled pip
Successfully installed pip
Cleaning up...
$ pip
Traceback (most recent call last):
  File "/usr/local/bin/pip", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/usr/local/lib/python2.7/site-packages/pkg_resources.py", line 2749, in <module>
    working_set = WorkingSet._build_master()
  File "/usr/local/lib/python2.7/site-packages/pkg_resources.py", line 446, in _build_master
    return cls._build_from_requirements(__requires__)
  File "/usr/local/lib/python2.7/site-packages/pkg_resources.py", line 459, in _build_from_requirements
    dists = ws.resolve(reqs, Environment())
  File "/usr/local/lib/python2.7/site-packages/pkg_resources.py", line 628, in resolve
    raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: pip==1.5.4

Using a python installed by homebrew.

$ python --version
Python 2.7.6
$ brew --version
0.9.5
$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.9.2
BuildVersion:   13C1021

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:30 (14 by maintainers)

github_iconTop GitHub Comments

22reactions
Ivozcommented, May 7, 2014

Either your pythons and paths are horribly messed up, or this might just be an old distribute/setuptools blowup.

Try these:

# Get rid of them
$ python -m pip uninstall -y setuptools
$ python -m pip uninstall -y distribute
# the next command should FAIL now because the above should be uninstalled
$ python -c "import pkg_resources"
# reinstall stuff now
$ python -m pip install -U --force-reinstall setuptools
$ python -m pip install -U --force-reinstall pip
# now check things work and are the same
$ python -m pip --version
$ pip --version
$ pip list
1reaction
gzurcommented, Feb 4, 2016

I just had this problem on Ubuntu 14.04 LTS after upgrading pip through pip.

Looked like this:

user@ubuntu_14_04_LTS:~$ pip
Traceback (most recent call last):
  File "/usr/local/bin/pip", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2749, in <module>
    working_set = WorkingSet._build_master()
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 444, in _build_master
    ws.require(__requires__)
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 725, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 628, in resolve
    raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: pip==1.5.6

After trying uninstalling both via pip and apt-get without ACTUALLY getting rid off it, I tracked down a file called pip (through which pip) in /usr/local/bin which contained the following script:

    user@ubuntu_14_04_LTS:/usr/local/bin$ cat pip
    #!/usr/bin/python
    # EASY-INSTALL-ENTRY-SCRIPT: 'pip==1.5.6','console_scripts','pip'
    __requires__ = 'pip==1.5.6'
    import sys
    from pkg_resources import load_entry_point

    if __name__ == '__main__':
        sys.exit(
            load_entry_point('pip==1.5.6', 'console_scripts', 'pip')()
        )

I just deleted this file and reinstalled with apt-get. There were actually two more files (pip2 and pip2.7) containing similar code which I deleted for good measure.

Works now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to upgrade pip using pip install - Stack Overflow
The reason this happened is because the folder you are trying to install pip is a folder that requires admin privileges to access....
Read more >
Installation — pandas 1.5.2 documentation
Installation#. The easiest way to install pandas is to install it as part of the Anaconda distribution, a cross platform distribution for data...
Read more >
Release and Version History — pipenv 2022.12.20.dev0 ...
Fix for pipenv lock fails for packages with extras as of 2022.8.13 . ... Updated setup.py to remove support for python 3.6 from...
Read more >
How to PIP Install Requests Python Package - ActiveState
Requests Installation. Check if Requests is already installed and up-to-date by entering the following command: python -m pip show requests.
Read more >
pip-upgrade-outdated - PyPI
Run pip install --upgrade for all outdated packages ( pip list --outdated ). Allow specifying which version of pip to run, and parallel...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found