Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

Pip ImportError on IncompleteRead

📅 2015-Jul-08 ⬩ ✍️ Ashwin Nanjappa ⬩ 🏷️ easy_install, importerror, pip, python-pip ⬩ 📚 Archive


I was using the Pip from the Ubuntu repositories, installed using the package python-pip. I upgraded some Python packages using Pip and after one of them failed, invoking pip for any command gave this ImportError on the name IncompleteRead:

$ pip list
Traceback (most recent call last):
  File "/usr/bin/pip", line 9, in <module>
    load_entry_point('pip==1.5.4', 'console_scripts', 'pip')()
  File "/usr/lib/python2.7/dist-packages/", line 351, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python2.7/dist-packages/", line 2363, in load_entry_point
    return ep.load()
  File "/usr/lib/python2.7/dist-packages/", line 2088, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "/usr/lib/python2.7/dist-packages/pip/", line 61, in <module>
    from pip.vcs import git, mercurial, subversion, bazaar  # noqa
  File "/usr/lib/python2.7/dist-packages/pip/vcs/", line 9, in <module>
    from import path_to_url
  File "/usr/lib/python2.7/dist-packages/pip/", line 25, in <module>
    from requests.compat import IncompleteRead
ImportError: cannot import name IncompleteRead


The Pip from Ubuntu can be very old and trails the packages a lot. This problem went away when I removed this Pip and installed the latest one from PyPI:

$ sudo apt remove python-pip
$ sudo easy_install pip

Tried with: Pip 1.5.4 (old) and 7.1.0 (new) and Ubuntu 14.04

© 2022 Ashwin Nanjappa • All writing under CC BY-SA license • 🐘📧