Hello,
I want to run a python script the uses the python package that ships internally with QGIS.
The script I wish to run includes
from qgis.core import (
QgsApplication,
QgsLayoutExporter,
QgsVectorLayer,
QgsVectorLayerJoinInfo,
QgsProject,
QgsProperty,
QgsRuleBasedRenderer,
QgsUnitTypes,
QgsSymbol,
QgsSymbolLayer
)
from qgis.PyQt.QtGui import QColor
In a very hacky fashion I have set up my environment like this:
nix-shell -p qgis 'qgis.override { extraPythonPackages = (ps: with ps; [ numpy future pandas gdal]);}' python39 'python39.withPackages(ps: with ps; [ ipython pandas gdal pyqt5])'
export PYTHONPATH=$PYTHONPATH:`which qgis`/../../share/qgis/python
And on running my script
python myscript.py ...
Get the following error:
2022-02-18 11:12:36,579 [INFO ] initialising QGIS
qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in ""
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Aborted (core dumped)
Any thoughts and advice appreciated