Python Disabled in QGIS?

This afternoon, I opened QGIS, and was greeted with a strange error message:

Couldn't load PyQGIS.
Python support will be disabled.
Traceback (most recent call last):
File "", line 1, in
RuntimeError: the PyQt4.QtCore module is version 1 but the qgis.core module
 requires version -1

QGIS will still open if Python support is disabled, but none of the geoprocessing tools will be available. The Vector menu won’t even show up! Clearly, this is bad news.

After a little research, I concluded that this version of QGIS (1.7.1 “Wroclaw”) was incompatible with the new PyQt4 library, which was passed to me as an update over the weekend. Eventually, a version of QGIS that is compiled against the new library will be available to install (and I hope that’s soon). But for now, the only solution for me is to downgrade my PyQt4 library from 4.8.6-1 to 4.8.3-2. This can be done from the command line:

sudo yum downgrade PyQt4

And QGIS is back to normal!

Note: this will only work in Fedora, RedHat, and other distros that use yum and rpm. For Ubuntu, you will have to use apt to perform the downgrade. See here for an example.

Comments are closed.