I am trying to install PyQT4 on Python 2.7.9, I am on Mac OS X, so i tried installing it via Homebrew and Macports, unfortunately non of them seemed to work.
This is what i tried:
brew install python qt pyqt pyside pyside-tools
also tried:
brew install PyQT4
On Macports:
sudo port install py27-pyqt4
No matter what I did, I was getting this error:
>>>> import PyQT4
Traceback (most recent call last):
File "", line 1, in
ImportError: No module named PyQT4
What can be the problem? Do i need to set env path for PyQT?
解决方案
Found out solution:
I installed PyQtX package, (PyQt binary for Mac OS X) from here.
and then specified PYTHONPATH with this:
export PYTHONPATH=/usr/local/lib/python2.7/site-packages:$PYTHONPATH
After typing in import PyQt4 it worked without any problems. (Case Sensitive)