在Mac OS 10.11上安裝python, pyqt
阿新 • • 發佈:2018-12-24
1.首先安裝homebrew,通過在終端中執行如下的命令:
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go/install)"
2.接著安裝python
brew
install python
3.通過編輯edit ~/.profile檔案把python加入環境變數
export PATH=/usr/local/bin:$PATH export PYTHONPATH=/usr/local/lib/python:$PYTHONPATH4.重新開啟terminal,然後開始安裝qt4,執行如下命令:
brew
install qt --HEAD
5.接著安裝pyqt4,執行如下命令
brew
install pyqt
5.接下來執行最後兩步:
mkdir -p /Users/zgf/Library/Python/2.7/lib/python/site-packages
echo 'import site; site.addsitedir("/usr/local/lib/python2.7/site-packages")' >> /Users/zgf/Library/Python/2.7/lib/python/site-packages/homebrew.pth
Done.:)