第一步:

1、下载brew:   /bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"

2、执行 source /Users/ddu/.zprofile  或 重启终端生效

3、brew doctor  检查是否安装成功

 

第二步:

1,查找python3 ,命令:brew search python3

2, 安装python3,命令:brew  install python3  。接下来就是等待。。当输出表示安装完成

 

第三步 Python 默认版本设置:

python3 就是我们刚安装的新版 python。
which python3 可以查看它的路径。
然后通过 alias 把默认的 python 指向我们的新路径。 

alias python="/opt/homebrew/bin/python3"

mac m1 安装python3

 

 


现在只是临时生效,还要执行 source ~/.bash_profile 才会永久生效

 

相关文章:

  • 2022-12-23
  • 2022-01-25
  • 2021-11-30
  • 2021-05-01
  • 2021-06-02
  • 2022-02-22
  • 2022-12-23
猜你喜欢
  • 2021-12-30
  • 2021-10-02
  • 2021-06-24
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案