Multiple Python versions under Windows coexist

Source: Internet
Author: User

People who know Python know that Python has 2.x and 3.x versions, and python3.x versions are not backwards compatible, but depending on the specific needs, sometimes 2.x and 3.x coexist, Python coexistence itself is not a problem, just need to set some environment variables and modify something to make it easier to use. This article mainly describes the Windows environment,

Method/Step
  1. First of all, of course, install the two different versions of Python you need, here I install 2.7 and 3.3, two versions of the installation sequence does not matter.

  2. The next step is to check the environment variables, the missing we need to add. Find the location of the environment variable first.

  3. 1.c:\python27

    2.c:\python27\scripts

    3.c:\ Python33

    4.c:\python33\scripts

    less which one, pay attention to semicolons separated.

  4. Then go to the Python2.7 installation directory to find the content and remove the Python.exe.

  5. Then enter the python3.3 installation directory. Find the Python.exe program and rename it to Python3.exe

  6. finally open the command-line interface to test it. Executing the python2 command enters the python2.7 interactive environment, and executing the PYTHON3 command enters the python3.3 interactive environment.

  7. The rest of the problem is the PIP problem. Two Python versions install the PIP to differentiate them later. Go to the Python installation path find the Scripts folder, go inside to find pip*-script.py, open modify the first sentence for the Python interpreter you want to specify




  8. orThe workaround used is to use the binary file editing tool to modify the "Pip.exe",

    Reference: Http://stackoverflow.com/questions/24627525/fatal-error-in-launcher-unable-to-create-process-using-c-program-files-x86

    Open with Hedit, then search for "C: \", find the corresponding location, then change the drive letter to "D", save, and then execute the "pip" command is OK.


    The "D:\Python27\Scripts" directory has a number of files are present in this situation, the right to change it.

    ====================== Document Information ======================

    Source: http://blog.csdn.net/testcs_dn/article/details/54176504



Null

Multiple Python versions under Windows coexist

Related Article

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.