[Qgis-developer] Do Python plugins already work with QGIS 3?

Andreas Neumann a.neumann at carto.net
Tue Dec 13 08:00:06 PST 2016


Hi Marco,

Thanks - this helped a lot. Apparently it was the missing python3-gdal 
bindings. I only had the bindings for python2. Processing now seems to 
work fine (at least the few tests I did).

However, db manager still fails to start with error message:

----------------------

2016-12-13T16:53:21    1    Traceback (most recent call last):
               File 
"/usr/local/share/qgis/python/plugins/db_manager/db_manager_plugin.py", 
line 108, in run
                 from .db_manager import DBManager
               File "/usr/local/share/qgis/python/qgis/utils.py", line 
647, in _import
                 mod = _builtin_import(name, globals, locals, fromlist, 
level)
               File 
"/usr/local/share/qgis/python/plugins/db_manager/db_manager.py", line 
36, in <module>
                 from .layer_preview import LayerPreview
               File "/usr/local/share/qgis/python/qgis/utils.py", line 
647, in _import
                 mod = _builtin_import(name, globals, locals, fromlist, 
level)
               File 
"/usr/local/share/qgis/python/plugins/db_manager/layer_preview.py", line 
27, in <module>
                 from qgis.gui import QgsMapCanvas, QgsMapCanvasLayer, 
QgsMessageBar
             ImportError: cannot import name 'QgsMapCanvasLayer'

----------------------

Can you confirm that DB-manager should work fine with the latest master?

Thanks,

Andreas


On 13.12.2016 16:40, Marco Bernasocchi wrote:
> could be,
> it could also be a PYTHONPATH issue depenndign where you installed the
> bindings.
>
> can you import them in a python prompt?
>
> to build gdal with python 3 you need to do some thing like:
> cd gdal/swig/python
> python3 setup.py build & python3 setup.py install
>
> IIRC gdal compiles in its source dir so for qgis for android I just used
> to copy the whole GDAL folder before building to keep a clean copy.
>
> more info:
> https://trac.osgeo.org/gdal/wiki/GdalOgrInPython
> https://trac.osgeo.org/gdal/wiki/BuildingOnUnix
>
> ciao
> Marco
>
>
> On 13.12.2016 16:23, Andreas Neumann wrote:
>> Hi,
>>
>> I get a message:
>>
>> ------------
>>
>> Unable to load GdalTools plugin.
>>
>> The required "osgeo [python-gdal]" module is missing.
>>
>> Install it and try again.
>>
>>
>> ------------
>>
>>
>> then there is a new error message:
>>
>>
>> --------------
>>
>>
>> ImportError: No module named 'osgeo'
>>
>>
>> --------------
>>
>>
>> I installed gdal from source, but enabled Python and also enabled shared
>> libraries.
>>
>>
>> Could it be that gdal was compiled with Python 2 while QGIS runs with
>> Python 3?
>>
>>
>> If that's the case, how can i compile GDAL with Python 3 support?
>>
>>
>> Can I compile gdal with Python 2 and 3 support if I want QGIS 2.x and
>> 3.x on the same machine?
>>
>> Thanks,
>> Andreas
>>
>> On 13.12.2016 15:55, Tom Chadwin wrote:
>>> Define "fail", I guess. Most plugins won't work without modification
>>> [citation needed], but it would be good to know *how* it fails, as you are
>>> right that there could be a more general issue.
>>>
>>>
>>>
>>> -----
>>> Buy Pie Spy: Adventures in British pastry 2010-11 on Amazon
>>> --
>>> View this message in context: http://osgeo-org.1560.x6.nabble.com/Do-Python-plugins-already-work-with-QGIS-3-tp5299693p5299694.html
>>> Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.
>>> _______________________________________________
>>> Qgis-developer mailing list
>>> Qgis-developer at lists.osgeo.org
>>> List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
>>> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer
>>
>>
>> _______________________________________________
>> Qgis-developer mailing list
>> Qgis-developer at lists.osgeo.org
>> List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
>> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer
>>



More information about the Qgis-developer mailing list