【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
複製代碼
相關文章
相關標籤/搜索