Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pip3 ImportError: cannot import name 'IncompleteRead'

Having trouble installing modules via pip3, tried several suggestions from top voted thread from Dec' 2014, but still getting the following:

sudo pip3 install send2trash
    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 558, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2682, in load_entry_point
    return ep.load()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2355, in load
    return self.resolve()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2361, 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'

On Ubuntu 15.10; tried removing python 3 completely and reinstalling, still having issues. Help?

Edit: UPDATE: Tried using my bootable USB to repair Ubuntu and get back to original config and reinstalled via sudo apt-get install python3-pip, but now it generates a crash report saying:

Sorry, the application pip3 has unexpectedly crashed.
like image 290
TB__ Avatar asked Jan 03 '16 19:01

TB__


2 Answers

This seems to be an issue with pip's interaction with the requests package. requests dropped the IncompleteRead module but older versions of pip, which you have, still rely on it, newer versions don't.

You should try updating pip via easy_install-3.5 (if you have Python 3.5) or easy_install-3 for other versions:

sudo easy_install-3.5 -U pip

or:

sudo easy_install-3 -U pip

and you should be good to go.

like image 99
Dimitris Fasarakis Hilliard Avatar answered Nov 11 '22 07:11

Dimitris Fasarakis Hilliard


Had similar error on Raspberry Pi. The solution was a combination of all proposals above:

 sudo pip install --upgrade pip
 sudo pip install --upgrade requests
 sudo easy_install3 -U pip
like image 32
Ivy Growing Avatar answered Nov 11 '22 07:11

Ivy Growing