[Qgis-developer] Compiling ui files with custom widgets creates wrong imports

Denis Rouzaud denis.rouzaud at gmail.com
Thu Aug 6 00:24:22 PDT 2015


You need to have qgis lib in your python path.
On windows, that would be C:\OSGeo4W\apps\qgis-dev\python\qgis

To check this, just do "from qgis.gui import *" in python. If you don't 
have an error, then pyuic4 will work properly.

Best wishes,
Denis



On 08/05/2015 11:27 PM, Anita Graser wrote:
> Hi,
>
> There seems to be an issue with custom widgets in Python. For example 
> this plugin bug: ImportError: No module named qgsfieldcombobox 
> (https://github.com/informeren/qgis-cartogram/issues/2)
>
> Compiling with
> pyuic4 -o cartogram_dialog_base.py cartogram_dialog_base.ui
> results in
> from qgsfieldcombobox import QgsFieldComboBox
> while it should be
> from qgis.gui import QgsFieldComboBox
>
> Is there some way to fix this on our side?
>
> Best wishes,
> Anita
>
>
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20150806/c2435d8a/attachment-0001.html>


More information about the Qgis-developer mailing list