Mac电脑配置python全局环境
Homebrew Download
-
Mac cmd命令行输入:下载homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
-
pyenv下载:
brew install pyenv
-
如果遇到unable access to github.com 的问题 (DHS污染)
- 通过 https://www.ipaddress.com/ 获得
raw.githubusercontent.com
的IP
[地址] - 点击搜索后,滚动到下面,找到
DNS Resource Records
: - 在本机的
hosts
文件中添加:- hosts文件在/private/etc/中
- 在Finder中按Shfit+Command+G打开前往
- 通过 https://www.ipaddress.com/ 获得
-
Warning:
/opt/homebrew/bin
is not in your PATH.- 配置环境:
e
- 配置环境: