2

My goal is to run QGIS processing algorithms using a python script on an ubuntu server.

I have installed QGIS on the server using

 $ sudo apt-add-repository ppa:ubuntugis/ubuntugis-unstable
 $ sudo apt-get update
 $ sudo apt-get install qgis

from this answer to Installing QGIS on Ubuntu. The install was successful.

I have tried importing qgis.core but I get the module not found error.

I think I need to add some lines to the PYTHONPATH variable based on other answers. I've added the following:

:/usr/lib/qgis/plugins/:/usr/lib/qgis/plugins:/usr/lib/qgis:/usr/share/qgis/python:/usr/share/qgis/python/plugins:/home/wporter/.local/share/QGIS/QGIS3/profiles/default/python:/home/wporter/.local/share/QGIS/QGIS3/profiles/default/python/plugins:/usr/share/qgis/python:/usr/share/qgis/python/plugins:/usr/bin/qgis/share/qgis/python:/usr/share/qgis/python

But I'm still not able to import qgis.core.

How can I direct Python to the correct libraries on the Ubuntu server?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.