在Mac OS 10.11上安装python, pyqt

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:$PYTHONPATH
4.重新开启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.:)

你可能感兴趣的:(在Mac OS 10.11上安装python, pyqt)