【python】【基础】mac安装python3及pip

Mac安装Python3及pip

  1. 安装brew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

复制代码
  1. 经过brew安装python3
brew update
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/f2a764ef944b1080be64bd88dca9a1d80130c558/Formula/python.rb
复制代码
  1. 安装pip
curl https://bootstrap.pypa.io/ez_setup.py -o - | sudo python
sudo easy_install pip
复制代码
  1. 配置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
复制代码
相关文章
相关标签/搜索