System: Mac
Python version: 2.7\3.5\3.6
Reason for demand:
python2.7 (default) installed on your computer, execute python command to open
Work needs to be installed python3.5, execution Python3 can command to open
Later installed Anaconda, Python3 start changed to 3.6 version, want to use python3.5 will have to execute python3.5 *.py, python3 by default is 3.6 Version, some headaches
Workaround:
Open ' ~/.bash_profile ', add "Alias" in front of the version that needs to be opened by default,save the file, restart the terminal, successfully
When you run Python, the python3.5 is turned on , and the other python2.7/python3.5/python3.6 commands still work.
Example: Alias path= "/library/frameworks/python.framework/versions/3.5/bin:${path}"
Reference :
https://www.zhihu.com/question/30941329/answer/51489517
Other _ Change the version number of Python open in Mac system terminal