This tutorial shows how to build and install PyQt4 with python2.7 in Ubuntu.
If you want to use it with different version of python than 2.7 than replace every 2.7 in instructions below with the version you are using and it should work (tested with 2.6 and 3).
First, you need some prerequities:
Then, try to install the PyQt and SIP using pip (it fails but it downloads the required packages to your ~/build/ folder).
After that go to ~/build/SIP and install it
Finally go to ~/build/PyQt and install it
Note: as PyQt is a big project - building it may take some time..
And that's all. You can test it by trying to import QtCore in python2.7
If there is no import error - you have PyQt4 installed correctly!
If you want to use it with different version of python than 2.7 than replace every 2.7 in instructions below with the version you are using and it should work (tested with 2.6 and 3).
First, you need some prerequities:
sudo apt-get install python-pip python2.7-dev libxext-dev python-qt4 qt4-dev-tools build-essentialThen, try to install the PyQt and SIP using pip (it fails but it downloads the required packages to your ~/build/ folder).
pip install PyQtpip install SIPAfter that go to ~/build/SIP and install it
cd ~/build/SIP
python2.7 configure.py
make
sudo make installFinally go to ~/build/PyQt and install it
Note: as PyQt is a big project - building it may take some time..
cd ~/build/PyQt
python2.7 configure.py
make
sudo make install
And that's all. You can test it by trying to import QtCore in python2.7
python2.7
>>> from PyQt4 import QtCore, QtGui
If there is no import error - you have PyQt4 installed correctly!