I would like to execute a Python script which uses QGIS Processing tools.
On Ubuntu 20.x I installed qgis
, qgis-common
, python3-qgis
and python3-qgis-common
.
My objective is to execute the tool Exploe HStore Field from shell within a python script.
The following lines are working well within the QGIS-GUI Python Console
from qgis.core import processing
from qgis.core import *
processing.run("qgis:explodehstorefield", {
'INPUT' : '/home/myacc/geodata.gpkg|layername=points',
'FIELD' : 'other_tags',
'EXPECTED_FIELDS' : '',
'OUTPUT' : 'ogr:dbname=\'/home/myacc/geodata_explode.gpkg\' table=\"points\" (geom)' })
My problem is, that processing.run
is not recognized outsite the QGIS-GUI Python console.
I tried to create a pre-build script from the modeller, but there is the same problem.