Python2.x and 3.x in the same version do not affect the solution (do not use the development Tools IDE installation, easy to clutter)

Source: Internet
Author: User

In the same PC, if the Python2 and PYTHON3 environments are installed at the same time, an error occurs when the Python command is executed, and the operating system finds the default configuration to perform. How to let Python2 and python3 work together and do not affect each other.

But because of the need for work, we may need multiple Python versions on our personal PC to co-exist, what settings should be made, this chapter on the issue of analysis and use of the introduction

Configuration for 1.python2 and Python3 versions to enter the Python2 installation path as follows

Modify Python.exe, rename to Python2.exe

Access to the Python3 installation path

Rename file Python.exe to Python3.exe,pythonw.exe for Pythonw3.exe


Configure environment variables to configure the paths of both Python2 and Python3 to the PATH environment variable

At this point, we open the Command Line window of the system, enter the command python2 into the Python2 development environment, enter the naming python3 into the Python3 development environment

2. Commands executed when PIP installs the module

Under normal circumstances, we also need to use the python pip command to install and configure third-party modules, at which point the direct execution of PIP will cause an error.

The General installation command syntax is as follows

Copy the Code code as follows:

Pip Install module name

However, we have installed two versions of Python on the PC and modified the name of the executable file Python.exe, so the direct execution of PIP will result in an error.

2.1. Install a third-party module to Python2

Open the command line tool and execute the following command to install the required modules for Python2

Copy the Code code as follows:

python2-m pip Install (module name)

2.2. Install a third-party module to Python3

Open the command line tool and execute the following command to install the required modules for Python3

Copy the Code code as follows:

python3-m pip Install (module name)

2.3. View the PIP version

python*-M Pip-v


Original link: http://www.jianshu.com/p/9928b741f154

The 2.5 XLRD,XLWT module resembles the setup.pyinstall command:

Python2 setup.py Install

Python3 setup.py Install

Python2.x and 3.x in the same version do not affect the solution (do not use the development Tools IDE installation, easy to clutter)

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.