mac 安装和管理多个Python版本

更新brew

brew update

brew install pyenv

 安装pyenv报错

==> Downloading https://raw.githubusercontent.com/Homebrew/homebrew-core/c1c28c143f4e28fc0059e66baa904104da25a41d/Formula/o/openssl@3.rb
curl: (7) Failed to connect to raw.githubusercontent.com port 443 after 8 ms: Couldn't connect to server

Error: pyenv: Failed to download resource "openssl@3.rb"
Download failed: https://raw.githubusercontent.com/Homebrew/homebrew-core/c1c28c143f4e28fc0059e66baa904104da25a41d/Formula/o/openssl@3.rb

 

报错解决

1)打开网站: https://www.ipaddress.com/
查询一下 raw.githubusercontent.com对应的IP 地址

 

绑定hosts后继续执行安装命令

 

 查看版本

pyenv -v

 

安装管理多个Python

 

pyenv install --list

pyenv install 3.12.3

pyenv install 2.7.18

 

完成~

 

posted @ 2024-06-04 11:21  ToDarcy  阅读(119)  评论(0编辑  收藏  举报