6

I installed pip3 using apt-get install python3-pip however when I try to install any package I'm getting this type of error.

xxxxx@xxx:~$ pip3 install requests
Traceback (most recent call last):
  File "/usr/bin/pip3", line 9, in <module>
    load_entry_point('pip==1.5.6', 'console_scripts', 'pip3')()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 521, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2632, in load_entry_point
    return ep.load()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2312, in load
    return self.resolve()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2318, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/lib/python3/dist-packages/pip/__init__.py", line 74, in <module>
    from pip.vcs import git, mercurial, subversion, bazaar  # noqa
  File "/usr/lib/python3/dist-packages/pip/vcs/mercurial.py", line 9, in <module>
    from pip.download import path_to_url
  File "/usr/lib/python3/dist-packages/pip/download.py", line 25, in <module>
    from requests.compat import IncompleteRead
ImportError: cannot import name 'IncompleteRead'

I tried uninstalling pip and reinstalling however that's not made any difference.

Any idea how to resolve?

7

easy_install3 needed upgraded. This can be done by running the following in the terminal:

sudo easy_install3 -U pip
3

Traceback says you're missing requests lib. Try

apt-get install --reinstall python3-requests

pip as any other application require certain libraries. In this case it requires requests lib to download files from net. If you check python3-pip package requirements ( apt-cache show python3-pip ) you will see all the required packages. After installation you can use pip to update those libraries as well as pip itself ( pip install --upgrade pip ).

You can try to update pip ( as above ) and requests or simply download pip directly from net: wget https://bootstrap.pypa.io/get-pip.py && python get-pip.py

NOTE: if you have python3-requests installed and it still is not working, it means that you have either requests lib in too old version or something is wrong with your python path. Reinstalling pip might help with that:

apt-get remove --purge python3-pip && apt-get install python3-pip
  • 1
    I'm confused. I thought that pip was supposed to handle the installation of requests so why am I using apt-get for that? I've installed that and get no errors however if I use pip3 install requests I get the same error. Maybe I'm not supposed to use pip3 install if I've installed through apt-get. – Eamonn Doyle May 2 '15 at 13:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.