What Should i do to get PyQt4 working?
Installed python-qt4 and pyqt4开发者_JAVA技巧-dev-tools packages on ubuntu
Python 2.6.6 (r266:84292, Sep 15 2010, 15:52:39)
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from PyQt4 import QtGui
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
RuntimeError: the sip module implements API v8.0 but the PyQt4.QtGui module requires API v7.1
What Should i do to get PyQt4 working?
Looks like your apt source list messed up. Go apt-get update and apt-get upgrade pyqt* python-qt4 and try again.
I had the same problem. I cleaned, erased all the files of installation and started all over again following these instructions:
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-essential
Then, try to install the PyQt and SIP using pip (it fails but it downloads the required packages to your ~/build/ folder). pip install PyQt pip install SIP
After that go to ~/build/SIP and install it cd ~/build/SIP python2.7 configure.py make sudo make install
Finally 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
Source: http://problemssol.blogspot.com/2010/12/compile-and-install-pyqt4-for-python27.html
精彩评论