Pip Broke. How to Fix Distributionnotfound Error

pip broke. how to fix DistributionNotFound error?

I find this problem in my MacBook, the reason is because as @Stephan said, I use easy_install to install pip, and the mixture of both py package manage tools led to the pkg_resources.DistributionNotFound problem.
The resolve is:

easy_install --upgrade pip

Remember: just use one of the above tools to manage your Py packages.

DistributionNotFound error after upgrading pip

The brutal way:

Assuming you are using homebrew for Mac (because I see /usr/local/Cellar), I suggest to

  • remove (or backup) /usr/local/lib/python2.7, and
  • brew rm python && brew install python.

This will definitely install pip 1.3.3 alongside of python. Your distribute will also be 0.6.35.

The soft way:

From /usr/local/lib/python2.7/site-packages just remove:

  • easy-install.pth
  • pip-1.2.1-py2.7.egg or other versions of pip you have.
  • distribute-0.6.34-py2.7.egg or other versions

Then, brew rm python && brew install python. This will leave all your other bindings from brew and installed stuff intact. Python, pip and distribute will be replaced with up-to-date versions.

additionally:

Please check that you don't have a distribute or setuptools or pip located in /Library/Python/2.7/site-packages. That dir is re-used by all python 2.7 versions (brewed or from OS X) and will interferre with the pip/distribute already installed by Homebrew.

Easy_install and pip broke: pkg_resources.DistributionNotFound: distribute==0.6.36

If you do this then it will work:

cd /usr/local/lib/python2.7/site-packages && ls

Find pip-1.4.1-py2.7.egg-info and distribute-0.6.49-py2.7.egg in the directory.

Then the following steps fixed the issue:

  • Changed the pip version to 1.4.1 in /usr/local/bin/pip
  • Changed distribute version to 0.6.49 in /usr/local/bin/easy_install

pip install not working, Distribution not found

One of the problem is that from now on we to use pip3 instead of just pip. Another problem is that the open ~/.zshrc file need to be updated with the same open ~/.bash_profile instruction from anaconda.

IN CONCLUSION

I think that for installing pip packages you need to use the pip3 command or you could write an alias file where you substitute pip with pip3.

Then for actually using conda I followed this article so that it overrun the zhs of the mac config.

Getting Anaconda to work

Broken pip3 and easy_install3: DistributionNotFound

I had to download and run two scripts, get-pip.py and ez_setup.py

sudo python3 get-pip.py
sudo python3 ez_setup.py

Those fixed both pip3 and easy_install3.

pkg_resources.DistributionNotFound: The 'pipenv==2018.10.13' distribution was not found and is required by the application

I had the same problem. You should reinstall pipenv using the same package manager you used the first time.

  • If the installation was done using pip, then:

    pip uninstall pipenv
    pip install pipenv
  • If you are using brew, then you must run the commands exposed by Andrei

    brew uninstall pipenv
    brew install pipenv

To check if pipenv installation was successfully completed, run:
pipenv --version

From the comments, alternatively use:

brew reinstall pipenv


Related Topics



Leave a reply



Submit