I'm trying to follow the instructions here How to evaluate raster calculator expressions from the console? to set up the python console to to use the raster calculator.

I tried:

from qgis.analysis import  QgsRasterCalculator, QgsRasterCalculatorEntry

But that gave

Traceback (most recent call last):
  File "<input>", line 1, in <module>
ImportError: cannot import name QgsRasterCalculator

The following seems to work fine, but doesn't get me the raster calculator commands.

from qgis.analysis import *

What is going on, and how do I fix it?


QgsRasterCalculator requires QGIS 2.0 or higher. It will not import for QGIS 1.8.

Your Answer

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

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