Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Easy_install and Pip doesn't work

Easy_install and Pip doesn't work anymore on python 2.7, when I try to do:

sudo easy_install pip

I get:

Traceback (most recent call last):
  File "/usr/bin/easy_install", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/usr/bin/lib/python2.7/site-packages/distribute-0.6.19-py2.7.egg/pkg_resources.py", line 2713, in <module>
    parse_requirements(__requires__), Environment()
  File "/usr/bin/lib/python2.7/site-packages/distribute-0.6.19-py2.7.egg/pkg_resources.py", line 584, in resolve
    raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: distribute==0.6.15

And when I try:

sudo pip install [package]

I get:

Traceback (most recent call last):
  File "/usr/bin/pip", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/usr/bin/lib/python2.7/site-packages/distribute-0.6.19-py2.7.egg/pkg_resources.py", line 2713, in <module>
    parse_requirements(__requires__), Environment()
  File "/usr/bin/lib/python2.7/site-packages/distribute-0.6.19-py2.7.egg/pkg_resources.py", line 584, in resolve
    raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: pip==0.8.2

I've already install both of them (and yes, first deleted them), but no result...

Thanks!

(I tried already this post)

like image 202
Francis Michels Avatar asked Aug 18 '11 15:08

Francis Michels


People also ask

Where is easy_install located?

By default, the easy_install install's the packages in the Python's primary site-packages directory. It would usually be /usr/lib/python2.

Do I need to install pip?

Usually, pip is automatically installed if you are: working in a virtual environment. using Python downloaded from python.org. using Python that has not been modified by a redistributor to remove ensurepip.


2 Answers

I had this issue where python's distribute package wasn't installed for some reason. After following the instructions on python-distribute, i got it working.

install the distribute package as follows:

$ wget https://web.archive.org/web/20100225231201/http://python-distribute.org/distribute_setup.py
$ python distribute_setup.py

EDIT: http://python-distribute.org/distribute_setup.py no longer works:

hopefully this will resolve your problem with running

$ sudo easy_install

Happy Coding!

like image 59
Fydo Avatar answered Oct 08 '22 11:10

Fydo


If you installed a new version of easy_install through Distribute, the new command may have been installed in another directory, most likely /usr/local/bin/. But the traceback shows you were using /usr/bin/easy_install. Try this:

sudo /usr/local/bin/easy_install ...
like image 42
Ned Deily Avatar answered Oct 08 '22 11:10

Ned Deily