mac设置默认python为python3

1.首先打开终端

2.打开配置文件,输入open ~/.bash_profile

3. 在配置文件中,写入python的外部环境变量(后面为python的位置,本人的版本是3.6)

 export PATH=${PATH}:/Applications/anaconda3/bin/python.app


4.重命名python

alias python="/Applications/anaconda3/bin/python3.6"

4.关闭文件后,在终端调用 source ~/.bash_profile

5.重启终端,调用 python,查看是否修改成功


猜你喜欢

转载自blog.csdn.net/qq_34218221/article/details/80765831