Executing a GRASS command in QGIS 2.18.16 via Processing returns the error:
This algorithm cannot be run :-( It seems that GRASS is not correctly installed and configured in your system. Please install it before running GRASS algorithms.
The solutions provided at Cannot run Grass algorithms in QGIS 2.18 on Ubuntu 16.04 do not work for the following reasons.
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() \
I do not believe that line 251 is the correct location for this code. This area of code is between line 242 and 264.
@staticmethod
def writeGrass7Window(filename):
out = open(filename, 'w')
out.write('proj: 0\n')
out.write('zone: 0\n')
out.write('north: 1\n')
out.write('south: 0\n')
out.write('east: 1\n')
out.write('west: 0\n')
out.write('cols: 1\n')
out.write('rows: 1\n')
out.write('e-w resol: 1\n')
out.write('n-s resol: 1\n')
out.write('top: 1\n')
out.write('bottom: 0\n')
out.write('cols3: 1\n')
out.write('rows3: 1\n')
out.write('depths: 1\n')
out.write('e-w resol3: 1\n')
out.write('n-s resol3: 1\n')
out.write('t-b resol: 1\n')
out.close()
I tried the second solution to add a soft link but that returned an error.
sudo ln -s /usr/bin/grass72/usr/bin/grass70 ln: failed to create symbolic link './grass70': File exists
I uninstalled GRASS, disconnected from the unstable ubuntu qgis repository and reinstalled GRASS but it reinstalls 7.2. There is no version 7.0 available at GRASS for download.
How do I get GRASS to work within Processing using Ubuntu QGIS 2.18.16?
apt-cache policy grassto see what is available for you. – AndreJ Feb 07 '18 at 16:38