I do most of my work in Windows and have a good python27 set up like I like it. I recently installed virtualBox and got a Ubuntu Machine running on it and am trying to get PyQt4 installed on it. I installed from apt-get and updated everything, however, when I try to import from PyQt4
from PyQt4 import QtCore
I get a runtimeError:
RuntimeError: the sip module implements API v9.0 to v9.1 but the PyQt4.QtCore module requires API v8.1
I am sure this is a problem that I would have the knowledge base to solve in Windows, but my Linux inexperience is getting the better of me here and I have installed something incorrectly. The error leads me to believe I have a SIP version that is too fancy for my PyQt version...anybody have any experience with this?
Edit: If I try the import again after receiving the error it seems to work. Doing this I obtained the version info.
cfg.pyqt_version_str
Out[9]: '4.9.3'
cfg.sip_version_str
Out[10]: '4.14.3-snapshot-55188026fe6d'
Not sure what all that snapshot business is about.
I just tested an install of sip/pyqt via apt-get
and it installed:
The sip version you are reporting is a development snapshot. I recommend removing all of it, doing a sudo apt-get update
and then sudo apt-get install python-sip python-qt4
again.
Otherwise, you can do the latest stable version from source:
If you have mixed installations, try and remove all of that. With pip you can do pip remove sip
. Or you can go into a python shell and find out where it is, then manually remove it:
$ python
>>> import sip
>>> print sip
# path to sip
If you need to use Qt 4.7, these version work together (build worked on x86_64 Centos6)
PyQt 4.10.4
SIP 4.15.5
QT 4.7.4
If you need Qt 4.8, these versions worked together for a build of PyQt4:
PyQt 4.11
SIP 4.16
QT 4.8.x
Using these steps to build PyQt4:
python configure-ng.py -g
make
make install
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With