[Qgis-user] Unable to use system PyQt alongside QGIS 2.16

François-Xavier Thomas francois-xavier.thomas at airinov.fr
Wed Jul 13 08:27:14 PDT 2016


Hello all,

I maintain an internal mirror of the qgis.org Debian repos where I work, 
so I generally upgrade QGIS ahead of my colleagues to test each new version.

I did so with the latest 2.16 packages, and I noticed that QGIS 
additions to PyQt4 break the system packages when imported in the wrong 
order (the opposite import order works just fine) :

from PyQt4 import QtCore
from qgis.core import *
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "/usr/lib/python2.7/dist-packages/qgis/__init__.py", line 26, in 
<module>
     from qgis.PyQt import QtCore
   File "/usr/lib/python2.7/dist-packages/qgis/PyQt/QtCore.py", line 28, 
in <module>
     sip.setapi(api, 2)
ValueError: API 'QDate' has already been set to version 1

I realize that these are pre-release packages, but I wasn't able to find 
a bug report. Should I submit one?

Also, is there a known workaround that I could use in the meantime?

I use Ubuntu 14.04 with the following repository :

   deb http://packages.airinov.fr trusty main

I also tested the Xenial version and found the same issue, but I haven't 
tested other distributions.

Thanks, and apologies if this is the wrong mailing list to post to,
François-Xavier



More information about the Qgis-user mailing list