Hi
> > > The model I need to use (which I did not write) requires python 2.7. > > > I had tried pip install previously but then it still fails with > ImportError: No module named grass.script. > > > Do you know what could be causing that? > > Interestingly, our docker containers just started to suffer from a > similar (same?) problem: > > File "/scripts/test_grass_session.py", line 3, in <module> > import grass.script as grass > ModuleNotFoundError: No module named 'grass' > > Weird, we need to investigate. > Grass_session works for me with both python2.7 and 3 in a Osgeo environment with grass 7.8.3 For me, the import modules work in this order in both python versions after pip installation. > *>>> import grass_session>>> from grass_session import Session* *>>> import grass.script as grass* For the final script to work, you will have to set environment variables, GISBIN (grass78 root folder) , GISRC (.grassrc78 file in demo location) and add grass78 'lib', 'bin' and 'scripts' folders to PATH variable. I run the script in python 3, where it worked without setting GISBIN and GISRC variables. I have only tested this approach in Windows 10 yet, and should work fine in Linux as well. Regards Sajid
_______________________________________________ grass-user mailing list [email protected] https://lists.osgeo.org/mailman/listinfo/grass-user
