2

*Running QGIS 3.6, GRASS 7.6; have both Python 2 and 3

I'm trying to run a GRASS algorithm in QGIS, and none of the GRASS tools are working. GRASS also isn't working in the standalone version. I have tried both QGIS and QGIS with GRASS.

I tried changing the name of my Python 3.7 path as that has caused issues in the past, and got this error when running in QGIS:

This algorithm cannot be run :-( The specified GRASS 7 folder "C:\Program Files\QGIS 3.6\bin\bin" does not contain a valid set of GRASS 7 modules. Please, go to the Processing settings dialog, and check that the GRASS 7 folder is correctly configured

When I run GRASS independently (for 7.4 and 7.6), the command line opens with the following error:

File "C:\Python37\Lib\site.py", line 177
  file=sys.stderr)
SyntaxError: invalid syntax
Press any key to continue . . .

Running grass within QGIS (v.clean tool):

The following layers were not correctly generated. [....] You can check the 'Log Messages Panel' in QGIS main window to find more information about the execution of the algorithm.

There is nothing substantial in Log Messages, but looking through the GRASS log I found the same thing I was getting when trying to run GRASS standalone:

File "C:\Python37\Lib\site.py", line 177
file=sys.stderr)
^
SyntaxError: invalid syntax
Press any key to continue . . .

I checked my processing options: GRASS is activated and the docs are in the proper location.

I also tried looking for any errors around the 'syntax error' in Python37\Lib\site.py, as well as a couple of GRASS .bat files, but I don't know enough about using GRASS to actually tell if anything is wrong.

  • are you sure QGIS and GRASS can run on python 3.7? Python 2.7 and Python 3.7 are very much imcompatible – Paul H Mar 26 at 20:55
  • @PaulH I have Python 2.7 installed but I'm not familiar enough with GRASS to know how/what to change. I agree, though - it looks like GRASS is using 3.7 for some reason. I tried changing the 3.7 file path to force using 2.7 but got the first error in my post. – jyingling Mar 28 at 13:31
0

Note that GRASS GIS 7.4 and 7.6 only work with Python 2. We are close to a full update to Python 3 which is done in the current development version GRASS GIS 7.7 (to become 7.8 stable then).

If possible for you, consider to update to GRASS GIS 7.7 (AFAIK it is available in the OSGeo4W installer, under development section).

  • Thanks - I have Python 2.7 installed, what should I change so that GRASS isn't trying to use 3.7? – jyingling Mar 28 at 21:58
  • On Windows I don't really know - perhaps update the search PATH to switch the order of searching? I am more familiar with Linux... – markusN Mar 29 at 19:19

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.