First, download the Python installation package
Python official website: Address Download in Pthon install package, current Python 2.x latest version Python 2.7.14,python 2.x latest version Python 3.6.3, take Python 2.7.14 for example
Download complete, install package name Python-2.7.14.msi
Second, install Python
Run the downloaded Python-2.7.14.msi installation package
Install for all users: Installs Python,install just for me (not available on Windows Vista) to all user: Installs for me only (not available on Windows Vista)
By default select Install for all users, click the Next button to proceed to the next step.
Custom installation path, default C:\Python27\, click Next button to go to the next step.
When you select a step in the installation component, check all the components. In particular, select pip
and, select the Add python.exe to Path
Add python.exe to Path,会
add c: \ python27 \ to the system environment path variable, you can use "Python" directly at the command prompt, without the need for a full path. Click the Next button to proceed to the next step. If you forget to check, you can manually add to the environment variable after installation, refer to the following.
Complete
Third, view environment variables
Right mouse button This computer, properties--Advanced system settings, environment variables (N) ...
The system variable (S) is the setting of the global environment, which is valid for all users. The adminstrator user variable (U) is set by the Adminstrator user and is only valid for adminstrator users.
I choose path for the system variable (S).
Environment variables that are selected before installing Pyhon and when installing Pyhon pip
Add python.exe to Path后
.
In fact, choosing Pip will add C:\Python27\Scripts to the environment variable, and the Add Python.exe to path adds C:\Python27\ to the environment variable.
If you do not have pip
Add python.exe to Path后
an environment variable selected during installation, you can manually add C:\Python27\Scripts and C:\Python27\ to the environment variables after you install Python.
C:\Python27\Scripts
C:\Python27\
If you do not know how to modify environment variables, you can re-python setup, select Change Python 2.7.14, choose Add Python.exe to Path.
Iv. Python Interactive environment
Win+r enter CMD to open a command prompt window
Enter Python, carriage return, and see the following hints for Python version information, indicating that the Python installation was successful.
If you are prompted that ' python ' is not an internal or external command, is not a running program or a batch file, and you do not add Pyhton to the environment variable, you need to manually add C:\Python27\ to the environment variable
Enter exit () to exit the Python interactive environment when entering the Python interactive environment
V. Easy_install and PIP
Easy_install and PIP are package management tools, and Pip is an improved version of Easy_install that provides better hints.
In the Python 2.7.14 installation package, Easy_install is the default installation, and Pip is checked for installation by default.
After installation, open the path C:\Python27\Scripts
The installation is checked on the line, if you forget, you can reinstall. Or the command prompt window switches to C:\Python27\Scripts, enter the command easy_install pip to install pip
Command Prompt window input pip, enter, see the following prompt message stating that PIP installation succeeded, of course, the premise has been added C:\Python27\Scripts to the environment variable.
Without adding C:\Python27\Scripts to the environment variable and entering PIP directly, you will be prompted that ' Pip ' is not an internal command and is not a running program or batch file.
Building a Python environment under the Windows system