On Ubuntu14.04, the PIP version downloaded by sudo apt-get install python-pip is somewhat old, and the following problems are likely to occur when used
[Email protected]:~# PIP Traceback (most recent call Last): File"/usr/bin/pip", line9,inch<module>Load_entry_point ('pip==1.5.4','console_scripts','Pip') () File"/usr/lib/python2.7/dist-packages/pkg_resources.py", line351,inchload_entry_point return get_distribution (Dist). Load_entry_point (group, name) File"/usr/lib/python2.7/dist-packages/pkg_resources.py", line2363,inchLoad_entry_point return ep.load () File"/usr/lib/python2.7/dist-packages/pkg_resources.py", line2088,inchLoad Entry= __import__ (Self.module_name, Globals (), Globals (), ['__name__']) File"/usr/lib/python2.7/dist-packages/pip/__init__.py", line One,inch<module>From pip.vcs import git, mercurial, Subversion, Bazaar # NOQA File"/usr/lib/python2.7/dist-packages/pip/vcs/mercurial.py", line9,inch<module>From pip.download import Path_to_url File"/usr/lib/python2.7/dist-packages/pip/download.py", line -,inch<module>From requests.compat import incompletereadimporterror:cannot import name Incompleteread
This is because the PIP version installed through Apt-get is too old, the old PIP version relies on Requests.compat.IncompleteRead, and has been removed from the 2.4.0 version of Requests
Requests.compat.IncompleteRead, the workaround is to uninstall the PIP (the command is sudo apt-get remove python-pip) and then download the installation again in the following way
wget https://bootstrap.pypa.io/get-pip.py--no-check-certificatesudo python get-pip.py
After the installation, test it, found that does not recognize the PIP command, the amount, I do not know how, the solution is to build a soft rib in the/usr/bin directory, pointing to/usr/local/bin/pip
[Email protected]:~$ pipfile or directory # $PATH value contains/usr/bin[email protected] Which pip/usr/local/bin/pip # $PATH value contains/usr/local/bin[email protected]-test2:~$ [ Email protected]echo $PATH/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin :/usr/games:/usr/local/games[email protected]-test2:~$
How to install PIP on Ubuntu14.04