21

My pip is not working anymore.

Here is the output for a sudo pip install pyjs :

  File "/usr/bin/pip", line 9, in <module>
    load_entry_point('pip==1.5.6', 'console_scripts', 'pip')()
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 356, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2476, in load_entry_point
    return ep.load()
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2190, in load
    ['__name__'])
  File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 61, in <module>
    from pip.vcs import git, mercurial, subversion, bazaar  # noqa
  File "/usr/lib/python2.7/dist-packages/pip/vcs/mercurial.py", line 9, in <module>
    from pip.download import path_to_url
  File "/usr/lib/python2.7/dist-packages/pip/download.py", line 25, in <module>
    from requests.compat import IncompleteRead
ImportError: cannot import name IncompleteRead

How can i repair this ? :(

bob dylan
  • 371

3 Answers3

26

this has been answered here.

But I will paste the answer as I don't have enough points to mark this a duplicate.

apt-get installs a much older version of pip which can lead to problems, completely remove python-pip with:

apt-get remove --purge python-pip

then:

curl https://bootstrap.pypa.io/get-pip.py | sudo python

using sudo if required

6
    sudo apt install --reinstall python
    sudo apt purge python-pip
    wget https://bootstrap.pypa.io/get-pip.py
    sudo python get-pip.py

All problem done all of this problem result from /etc/pip.

Kevin Bowen
  • 20,055
  • 57
  • 82
  • 84
2

I got the same error. I did this and it worked!

sudo apt-get install --reinstall python2.7

This to reinstall python. Don't ever try to uninstall python ,it will crash your OS as part of Ubuntu is dependent on python.Then,

sudo apt-get purge python-pip

This is to remove pip.

 wget https://raw.github.com/pypa/pip/master/contrib/get-pip.py

Installs pip..`

sudo python get-pip.py

Then,you can install packages using pip like

sudo pip install package-name