Mac 将 Python2 升级为 Python3

版权声明: https://blog.csdn.net/Dongguabai/article/details/91347558

使用 Python3 已经是大势所趋,但是 Mac 自带的是 2.7 版本:

➜  ~ python --version
Python 2.7.10

可以执行:

➜  ~ brew install python3

安装完成后设置一下环境变量:

➜  bin which python3            
/usr/local/bin/python3
➜  bin vim ~/.bash_profile 
➜  bin vim ~/.zshrc  
alias python='/usr/local/bin/python3'

猜你喜欢

转载自blog.csdn.net/Dongguabai/article/details/91347558
今日推荐