<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Hello, </p>
<p>I've got problems with an old development environment, that I use
to maintain my plugins.<br>
</p>
<p>I want to compile a QGIS plugin that I created myself.<br>
</p>
<p>I'm working with QGIS 2.18 and I've got an error with pyuic4 and
a UI file :<br>
</p>
<p>My version of pyuic4_ : 4.12.1 <br>
<br>
<b><span class="moz-txt-underscore">The message error<span
class="moz-txt-tag"> </span></span></b><b> : </b><br>
<br>
Makefile:52: recipe for target 'ui_bdtravaux_sortie.py' failed <br>
make: *** [ui_bdtravaux_sortie.py] Error 1 <br>
<br>
<br>
And <b>the </b><span class="moz-txt-underscore"><b>debug text</b><span
class="moz-txt-tag"></span></span> : (pyuic4 -d
ui_bdtravaux_sortie.ui) <br>
<br>
************************************************* <br>
<br>
# -*- coding: utf-8 -*- <br>
<br>
# Form implementation generated from reading ui file
'ui_bdtravaux_sortie.ui' <br>
# <br>
# Created by: PyQt4 UI code generator 4.12.1 <br>
# <br>
# WARNING! All changes made in this file will be lost! <br>
<br>
Traceback (most recent call last): <br>
File
"/usr/lib/python2.7/dist-packages/PyQt4/uic/port_v2/invoke.py",
line 34, in invoke exit_status = driver.invoke() <br>
File "/usr/lib/python2.7/dist-packages/PyQt4/uic/driver.py",
line 59, in invoke <br>
self._generate() <br>
File "/usr/lib/python2.7/dist-packages/PyQt4/uic/driver.py",
line 98, in _generate <br>
self._opts.resource_suffix) <br>
File "<i class="moz-txt-slash"><span class="moz-txt-tag">/</span>usr/lib/python2.7/dist-packages/PyQt4/uic<span
class="moz-txt-tag">/</span></i>__init__.py", line 173, in
compileUi <br>
winfo = compiler.UICompiler().compileUi(uifile, pyfile, <br>
from_imports, resource_suffix) <br>
File
"/usr/lib/python2.7/dist-packages/PyQt4/uic/Compiler/compiler.py",
line 55, in __init__ <br>
CompilerCreatorPolicy()) <br>
File "/usr/lib/python2.7/dist-packages/PyQt4/uic/uiparser.py",
line 183, in __init__ <br>
self.factory = QObjectCreator(creatorPolicy) <br>
File "/usr/lib/python2.7/dist-packages/PyQt4/uic/objcreator.py",
line 94, in __init__ <br>
modinfo = plugin_locals["moduleInformation"]() <br>
File "<string>", line 52, in moduleInformation <br>
File "<i class="moz-txt-slash"><span class="moz-txt-tag">/</span>usr/lib/python2.7/dist-packages/qgis<span
class="moz-txt-tag">/</span></i>__init__.py", line 26, in
<module> <br>
from qgis.PyQt import QtCore <br>
File "/usr/lib/python2.7/dist-packages/qgis/PyQt/QtCore.py",
line 28, in <module> <br>
sip.setapi(api, 2) <br>
ValueError: API 'QDate' has already been set to version 1 <br>
<br>
************************************************** <br>
</p>
<p><br>
I've use my plugin for years, but I have recently changed my
computer (and reinstalled all my development environment), and the
error appeared. <br>
</p>
<p>I wrote to pyuic4 support, and this is their answer : <br>
</p>
<p><i>"</i><i>This is a qgis bug. They change the API version which
is unsupported in production code."</i></p>
Is there a way to bypass this bug with these pyuuic4 and QGIS
versions?<br>
<p>Thanks for advance <br>
<br>
Vincent Damoy</p>
<div class="moz-signature"><br>
<div class="moz-signature"><br>
<div class="moz-signature"><br>
</div>
</div>
</div>
</body>
</html>