Mac system upgrade version of Python (Python2.7 upgrade to Python3.8.2)

Mac system is installed by default Python version 2.7, is currently a lot of projects to be based Python3.x above, there is a big difference between the two versions.
The following operations are the upgrade procedure:
1. First official website to download the installation package
Download: https: //www.python.org/downloads/release/python-382/ 'bit-select Installer 64 macOS
Here Insert Picture Description
2. In the visit of - " download, double-python-3.8.2-macosx10.9 on it all the way to the default installation
Here Insert Picture Description
after installation default path is /Library/Frameworks/Python.framework/Versions/3.8
can use the command open /Library/Frameworks/Python.framework/Versions/ 3.8 verify the path
3. modify environment variables
Note: If not vim tools, may be used to manually open command vi or Notepad play
Run: vim ~ / .bash_profile
at the end of the last added below line
alias python = "/ Library /Frameworks/Python.framework/Versions/3.8/bin/python3.8 "
shown below
Here Insert Picture Description
the above phrase means that the contents of the command python redirected to the new version installed, alias used for the alias used.

Run into force: source ~ / .bash_profile

4. Verify the upgraded version
execute the command: python -V
as shown below:
Here Insert Picture Description
Computer rental hang idle resources to earn money electricity
use of idle computer resources to earn pocket money (for students, housewives)
generated outside the chain tool (International Edition) Online
online generated outside the chain tool (Chinese version)

Published 16 original articles · won praise 2 · Views 397

Guess you like

Origin blog.csdn.net/momoringmok/article/details/104986605