How to install PIP on Ubuntu14.04

Source: Internet
Author: User
Tags mercurial

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.