Mac terminal更新python

1.下载python3 for MacOS
2.终端查路径,which python3
3.输入代码:
PATH=“路径”
import PATH
source ~/.bash_profile
就好啦!
如图:

Last login: Fri Mar 20 18:26:59 on ttys000
***$ python
Python 2.7.16 (default, Dec  3 2019, 07:02:07) 
[GCC 4.2.1 Compatible Apple LLVM 10.0.1 (clang-1001.0.37.14)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> "\uooC6"
'\\uooC6'
>>> exit()
***$ which python3
/Library/Frameworks/Python.framework/Versions/3.7/bin/python3
$ PATH="/Library/Frameworks/Python.framework/Versions/3.7/bin/python3"
***$ export PATH
***$ alias python="/Library/Frameworks/Python.framework/Versions/3.7/bin/python3"
***$ source ~/.bash_profile
***$ python
Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 26 2018, 23:26:24) 
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> 













你可能感兴趣的:(notes)