Windows environment configuration: install both Python2.7 and Python3.6 development environments

1. Download and install Python2.7 and Python3.6

Installation package download address: https://www.python.org/downloads/

 

Second, configure the system environment variables

add in environment variable

1. Installation directory\Python27

2. Installation directory\Python27\Scripts

3. Installation directory\Python36

4. Installation directory\Python36\Scripts

 

3. Modify the executable file in the installation directory

Find the installation directories of python2 and python3, and modify the names of python.exe and pythonw.exe in python2.7 and python3.6 to python2.exe, pythonw2.exe and python3.exe, pythonw3.exe.
Enter python2 Enter and python3 Enter in the command line, you can get the corresponding version number, which proves that the installation and configuration are successful.

Fourth, install pip

 Enter the command in the DOS command box, python2 -m pip install --upgrade pip --force-reinstall, and the reinstallation is successful.
 Enter the command in the DOS command box, python3 -m pip install --upgrade pip --force-reinstall, it shows that the reinstallation is successful.
Now you can view the pip information of two versions through pip2 -V and pip3-V
Later just run pip2 install XXX and pip3 install XXX to install the respective python packages. For example ipython, flake8, yapf, pylink, etc.

Five, install the interactive mode of python, ipython

pip2 install ipython
pip3 install ipython

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325260074&siteId=291194637