Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I installed OSGeo4W. I have no other Python version on my computer. I can import osgeo. But when I try to import qgis.core I am getting the error:

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

What could be the reason for that?

share|improve this question
    
Are you running this in QGIS python console? –  underdark Mar 8 '13 at 6:25
    
No, I am not. I am running it in the command line. Can I use QGIS only in the QIS python console? –  ustroetz Mar 8 '13 at 17:30

1 Answer 1

up vote 0 down vote accepted

This error means that the qgis.core module is not in your PYTHONPATH.

See the instructions in the PyQGIS cookbook on how to use the QGIS API from a python script running outside of QGIS:

http://docs.qgis.org/2.2/en/docs/pyqgis_developer_cookbook/intro.html#running-custom-applications

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.