Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pip Not Working Python 2.7

I am having a problem with pip just now, when I try to install something like pip install readline then I get an error:

Traceback (most recent call last):
  File "/usr/local/bin/pip", line 9, in <module>
    load_entry_point('pip==1.5.6', 'console_scripts', 'pip')()
  File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 549, in load_entry_point
  File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 2709, in load_entry_point
  File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 2369, in load
  File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 2375, in resolve
  File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 74, 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

So I ran cat /usr/local/bin/pip which tells me pip==1.5.6. I tried to find a solution online regarding this and one solution told to cd /usr/local/lib/python2.7/site-packages && ls but for me I see that folder is also empty.

like image 884
Yada Rahall Avatar asked Sep 12 '25 06:09

Yada Rahall


2 Answers

If upgrading pip doesn't work, you should try uninstalling it and reinstalling it. The error you're encountering is likely due to a mismatch in versions between pip and requests. First, I would remove pip and reinstall it from the source with python like this:

sudo apt-get remove python-pip
wget https://bootstrap.pypa.io/get-pip.py
sudo python get-pip.py

From the Ubuntu launchpad site

like image 50
wpercy Avatar answered Sep 14 '25 20:09

wpercy


Just check If You have installed python-setuptools rpm, If this is installed You can use easy_install pip on Redhat Based System.

like image 28
kvivek Avatar answered Sep 14 '25 19:09

kvivek