Mac安装Python3及pip
- 安装brew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
复制代码
- 经过brew安装python3
brew update
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/f2a764ef944b1080be64bd88dca9a1d80130c558/Formula/python.rb
复制代码
- 安装pip
curl https://bootstrap.pypa.io/ez_setup.py -o - | sudo python
sudo easy_install pip
复制代码
- 配置Python3.6代替系统原有Python
vim ~/.bashrc
复制代码
alias python='/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6'
export PIP_REQUIRE_VIRTUALENV=true
export PIP_RESPECT_VERTUALENV=true
复制代码