Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I install PyQT4 for Python 2.7?

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 "<stdin>", line 1, in <module>
ImportError: No module named PyQT4

What can be the problem? Do I need to set env path for PyQT?

like image 847
ShellRox Avatar asked Mar 12 '23 14:03

ShellRox


1 Answers

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)

like image 55
ShellRox Avatar answered Mar 19 '23 08:03

ShellRox