I'm quite new to Python, but I learned the basics with ArcPy in the Python software IDLE. It was quite easy to getting started: I start my script with "import arcpy" and i could start coding with arcpy functions.

But I'd like to work with QGis and PyQgis now. And I cannot make it work. When I start my script with "from qgis.core import *", i get an error message saying:

Traceback (most recent call last):
  File "<pyshell#1>", line 1, in <module>
    from qgis.core import *
ImportError: No module named qgis.core

I guess that I have to make a liaison between Python and the Qgis module somehow, it is probably very basic but I can't find the answer.

How do I set-up my python so it can use the qgis functions?

  • Seems to be a common error message: gis.stackexchange.com/… – PolyGeo May 23 '18 at 10:32
  • It is, but I don't find a clear answer to solve my problem. – JBihin May 23 '18 at 11:08
  • PyQgis is hard to understand after using ArcPy. You have to install different IDE (for example PyCharm and setup correctly to use it using). See: spatialgalaxy.net/2018/02/13/… for more info. – Mr. Che May 23 '18 at 11:10
  • Thank you, this is the kind of resource that I was looking for, I'm going to try this. – JBihin May 23 '18 at 11:11
  • @JBihin Link updated (for QGIS 3.0) Skip pb_tool installation. – Mr. Che May 23 '18 at 11:14

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.