I installed pyqt4 by using Homebrew. But when I import PyQt4 in python interpreter, It said that \"No module named PyQt4\". Can somebody help me with that?
You have to check which Python you are using. I had the same problem because the Python I was using was not the same one that brew was using. In your command line:
which pythonwhich brewcd /usr/local/lib/python2.7/site-packagesls //you can see PyQt4 and sip are hereusr/local/lib/python2.7/site-packages to your python path.open ~/.bash_profile //you will open your bash_profile file in your editor'export PYTHONPATH=/usr/local/lib/python2.7/site-packages:$PYTHONPATH' to your bash file and save itpython import PyQt4 // it is ok now