Mac下更新python

1. 查看python版本

python3 -V

2. 更新python版本

brew upgrade python

3. 查看python3的路径:

which python3

4. 修改.bash_profile文件

vim ~/.bash_profile
  • 插入python默认执行文件
alias python="/usr/local/bin/python3"

5. 应用环境变量

source ~/.bash_profile
  • 使用种方式更新python的同时会更新pip的版本

本文来自网络,不代表协通编程立场,如若转载,请注明出处:https://www.net2asp.com/61ef011f5c.html