It takes about 5 minutes to read this article
Windows
-
Open the download Python’s official website https://www.python.org/downloads/release/python-370/ x86: said is a 32-bit x86-64 computer: is a 64 – bit computer
Current Python versions are 2.x and 3.x. The 3.x version is recommended.
-
My Computer -> Properties -> Advanced System Settings -> Environment Variables
-
configuration
In the “variable values” column, copy the python path you installed into it, for example, C:\Python37
-
Note that when copying path C:\Python37, use a semicolon before it, and note that the semicolon must be a semicolon in English.
-
Test open CMD can enter Python to run. If Python is not a valid command, you might want to check the steps above
Mac
Mac platforms typically ship python2. x if you want to install Python3.x. It is best to install with HomeBrew.
- Install HomeBrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Copy the code
- test
brew doctor
Copy the code
- Install Python
brew install python
Copy the code
- To view
// The system has python2.7. The directory is /usr/bin/pythonwhichPython //brew installed python3.6 in the directory /usr/local/bin/python3
which python3
Copy the code
Unix/Linux
Unix/Linux generally comes with two versions. You can enter Python and Python3 on the terminal to view the versions.