Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Broken pip3 and easy_install3: DistributionNotFound

Tags:

python

pip

My pip3 seems to be broken:

$ pip3 --version
Traceback (most recent call last):
  File "/usr/bin/pip3", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python3/dist-packages/pkg_resources.py", line 2708, in <module>
    working_set.require(__requires__)
  File "/usr/lib/python3/dist-packages/pkg_resources.py", line 686, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python3/dist-packages/pkg_resources.py", line 584, in resolve
    raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: pip==1.5.6

I tried to fix it by reinstalling pip3 with easy_install3, but easy_install3 is also broken:

$ sudo easy_install3 --upgrade pip3
Traceback (most recent call last):
  File "/usr/bin/easy_install3", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python3/dist-packages/pkg_resources.py", line 2708, in <module>
    working_set.require(__requires__)
  File "/usr/lib/python3/dist-packages/pkg_resources.py", line 686, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python3/dist-packages/pkg_resources.py", line 584, in resolve
    raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: distribute==0.6.24dev-r0

Reinstalling pip3 from apt did not help either.

$ sudo apt-get remove python3-pip
$ sudo apt-get install --fix-missing -t testing python3-pip

I am running Debian 7 (stable). I have Python 3.4.2 installed from the testing repository.

like image 689
felixbade Avatar asked May 17 '15 15:05

felixbade


People also ask

Do I need both pip and pip3?

You have to use pip3 for it to be installed on Python3. So to install packages in python3, you should use pip3. NOTE:- Its not necessary that pip will install in python 2.7, if python2 is absent then pip will do it in python3. The above statement was if you have both the version of python installed.

Does Python 3 have pip3?

pip3 is the official package manager and pip command for Python 3. It enables the installation and management of third party software packages with features and functionality not found in the Python standard library. Pip3 installs packages from PyPI (Python Package Index).


1 Answers

Probably the easiest way to get everything working again is to download get-pip.py, then run

sudo python3 get-pip.py

This will upgrade pip to the latest version (currently 6.1.1) and update setuptools as well.

like image 94
MattDMo Avatar answered Oct 20 '22 22:10

MattDMo