Cannot run Grass algorithms in QGIS 2.18 on Ubuntu 16.04

I get the same error with the Ubuntugis version of QGIS and GRASS version 7.2.0.

It seems that 7.2 is not yet correctly adopted in processing. There is already a ticket for it: https://hub.qgis.org/issues/16019 and https://lists.osgeo.org/pipermail/qgis-developer/2017-January/046671.html

As a workaround, you may edit (as sudo) /usr/share/qgis/python/plugins/processing/algs/grass7/Grass7Utils.py line 251 to

            command = 'grass72 ' + Grass7Utils.grassMapsetFolder() \

and line 103 of Grass7AlgorithmProvider.py to

    return 'grass72'

Or downgrade to GRASS 7.0.3 from the main Ubuntu repo.

GRASS 6 commands will not work with GRASS 7, so you can deactivate the 161 GRASS commands.


Just another workaround from the mailing list https://lists.osgeo.org/pipermail/qgis-user/2017-January/038907.html

sudo ln -s /usr/bin/grass72 /usr/bin/grass70


UPDATE

Also reported with http://hub.qgis.org/issues/16110 and fixed with http://hub.qgis.org/projects/quantum-gis/repository/revisions/099e7a77f2c32f469539f542a31df7b0d4b77dd3 That should work for GRASS versions 7.0 up to 7.3

Unfortunately, the fix has not been applied to QGIS 2.18.4, so the workarounds are still necessary.


I fixed the problem by reinstalling grass 7.0.3 from the qgis repository. The grass from Ubuntugis repo is version 7.2, which is not support by QGIS.

  1. remove the GRASS GIS by sudo apt-get remove grass grass-core grass-doc grass-gui

  2. disable ubuntugis-unstable repository

  3. sudo apt-get install grass grass-gui

It works for me.