I am installing GRASS on linux. I have managed to download source code and compile and can now run grass
from the command line to open GRASS and start a session. I am trying to run python scripts outside of the GUI, however, and keep encountering the same error:
RuntimeError: Cannot find GRASS GIS start script: /bin/grass, set the right one using the GRASSBIN environm. variable
I have tried setting GRASSBIN to the output of which grass
which also didnt work, and I have run the grass --config path
command as outlined in these docs: https://grasswiki.osgeo.org/wiki/Working_with_GRASS_without_starting_it_explicitly#Python:_GRASS_GIS_7_with_existing_location
This still does not work. Please, what am I doing wrong? I am using Amazon Linux
EDIT:
grass is installed in $HOME
output of which grass
: /usr/local/bin/grass78
have also tried setting GRASSBIN to $HOME/grass/bin.x86_64-pc-linux-gnu
I have also set export GISBASE=$HOME/grass export PATH=$PATH:$GISBASE/bin:$GISBASE/scripts export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GISBASE/lib LOCATION is unset as this is the first time I am running script. The actual script doesnt do anything at the moment:
from grass_session import Session
from grass.script import core as gcore
from multiprocessing import Pool
# import grass.script as grass
# from grass.pygrass.modules.shortcuts import general as g
def main():
print("working")
if __name__ == "__main__":
main()
which grass
, the path to your GISDBASE and LOCATION, and the python script that you are running, which throws that error.