[QGIS-Developer] Pb QGIS 2.18 / pyuic4

Vincent Damoy vincent.damoy at espaces-naturels.fr
Thu Jun 6 02:52:24 PDT 2019


Hello,

I've got problems with an old development environment, that I use to 
maintain my plugins.

I want to compile a QGIS plugin that I created myself.

I'm working with QGIS 2.18 and I've got an error with pyuic4 and a UI file :

My version of pyuic4_ : 4.12.1

*The message error**: *

Makefile:52: recipe for target 'ui_bdtravaux_sortie.py' failed
make: *** [ui_bdtravaux_sortie.py] Error 1


And *the **debug text*: (pyuic4 -d ui_bdtravaux_sortie.ui)

*************************************************

# -*- coding: utf-8 -*-

# Form implementation generated from reading ui file 
'ui_bdtravaux_sortie.ui'
#
# Created by: PyQt4 UI code generator 4.12.1
#
# WARNING! All changes made in this file will be lost!

Traceback (most recent call last):
   File "/usr/lib/python2.7/dist-packages/PyQt4/uic/port_v2/invoke.py", 
line 34, in invoke exit_status = driver.invoke()
   File "/usr/lib/python2.7/dist-packages/PyQt4/uic/driver.py", line 59, 
in invoke
     self._generate()
   File "/usr/lib/python2.7/dist-packages/PyQt4/uic/driver.py", line 98, 
in _generate
     self._opts.resource_suffix)
   File "/usr/lib/python2.7/dist-packages/PyQt4/uic/__init__.py", line 
173, in compileUi
     winfo = compiler.UICompiler().compileUi(uifile, pyfile,
from_imports, resource_suffix)
   File 
"/usr/lib/python2.7/dist-packages/PyQt4/uic/Compiler/compiler.py", line 
55, in __init__
     CompilerCreatorPolicy())
   File "/usr/lib/python2.7/dist-packages/PyQt4/uic/uiparser.py", line 
183, in __init__
     self.factory = QObjectCreator(creatorPolicy)
   File "/usr/lib/python2.7/dist-packages/PyQt4/uic/objcreator.py", line 
94, in __init__
     modinfo = plugin_locals["moduleInformation"]()
   File "<string>", line 52, in moduleInformation
   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've use my plugin for years, but I have recently changed my computer 
(and reinstalled all my development environment), and the error appeared.

I wrote to pyuic4 support, and this is their answer :

/"//This is a qgis bug. They change the API version which is unsupported 
in production code."/

Is there a way to bypass this bug with these pyuuic4 and QGIS versions?

Thanks for advance

Vincent Damoy




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20190606/6560810c/attachment.html>


More information about the QGIS-Developer mailing list