PIP error when installing both Python2 and python3 locally

Source: Internet
Author: User

Introduction:

After the installation is complete, want to test two version of the PIP can work correctly, the result Python3 can work normally, but PIP2--version will error, error information as follows:

Traceback (most recent): File"/usr/local/bin/pip", line9,inch<module>Load_entry_point ('pip==1.3.1','console_scripts','Pip') () File"/usr/local/lib/python2.7/dist-packages/pkg_resources.py", line378,inchLoad_entry_pointreturnget_distribution (Dist). Load_entry_point (group, name) File"/usr/local/lib/python2.7/dist-packages/pkg_resources.py", line2565,inchLoad_entry_point raise Importerror ("Entry point%r not found"%((Group,name),)) Importerror:entry Point ('console_scripts','Pip') Not found

I do not know that we have not encountered this problem, or have met but very simple to solve, not worth remembering, not found in the online valuable solutions;

But when the new idea, the new installation of two versions of Python, began to realize that the version of the PIP should be installed problems;

The following will be my solution to the idea of writing;

Solution Ideas:

In fact, it is not the solution to this problem, but to circumvent this problem, from the new way to install two versions of PIP, install Py2-py3 common PIP version:

The Python installation package requires the Package management tool PIP, but when both Python2 and Python3 are installed, Pip is just one of the versions, and the following will provide a way to modify the two-version Pip so that the two Python versions of PIP can coexist.

In the DOS command box, enter the command, python3-m pip install--upgrade pip--force-reinstall, to show that the reinstallation was successful.

In the DOS command box, enter the command, python2-m pip install--upgrade pip--force-reinstall, to show that the reinstallation was successful.

The two versions of PIP information can now be viewed through pip2-v and pip3-v, with the ability to install their own Python packages later by running Pip2install xxx and pip3 install XXX.

At this point, PIP2 and PIP3 modified successfully.

Pip error when installing Python2 and python3 locally at the same time

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.