Windows
Version selection
This learning process is used for the preparation of server-side automation scripts, using version 2.7, and optionally 3.6 versions if required
https://www.python.org/downloads/windows/
Install the installation package
Control Panel \ All Control Panel items \ System
Select Advanced System Settings
Select environment variable settings in the Advanced tab page
Add the path to the Python installation in path
Check the installation
Enter Python in Cmd to see if the installation was successful
Linux
Version selection
This learning process is used for the preparation of server-side automation scripts, using version 2.7, and optionally 3.6 versions if required
https://www.python.org/downloads/source/
Install the installation package
Installation without dual version presence
1) Download the source package
2) Unzip the source package and enter the folder
./configure; Make && make install
3) Use Python-v to see if the installation is successful and the installation will display Python version information
Requires dual version to install Python version
1) ditto, need to download 3.6 source Package
2) Unzip the source package and enter the folder
You need to manually create a Python directory before installing mkdir/usr/local/python3.6
Installation directories need to be manually specified at install time
./configure--prefix=/usr/local/python3.6
Make && make install
3) post-installation configuration
Back up the original Python launcher mv/usr/bin/python/usr/bin/python_old
Soft-connect the newly installed Python version to the original startup program Ln-s/usr/local/python3.6/bin/python3.6/usr/bin/python
4) Modify the Python path in the Yum source
Vi/usr/bin/yum
- #!/usr/bin/python modified to:/usr/bin/python_old
Installation Check
Python-v viewing the Python installation version
Simply write a python program that outputs Hello World
# python
>>> print "Hello World"
Hello World
>>> print ' Hello World '
Hello World
This article is from the "Coarse bread" blog, make sure to keep this source http://culiangmianbao.blog.51cto.com/10475024/1972948
Configuration of Python installation and environment variables in Windows and Linux environments