[GRASS-user] issue with grass_session on MacOSX: Cannot find GRASS GIS start script

Jón Eiríksson jeir at hi.is
Mon Sep 3 10:27:28 PDT 2018


Hi again, - replace the python script with the following (apologies 
version confusion):

#!/usr/bin/env python
#-*- coding:utf-8 -*-

from grass.script import core as grass
from grass.script import db as grass

from grass_session import Session
from grass.script import core as gcore

# create a new location from EPSG code
with Session(gisdb="/Users/jon/a_tmp", location="a_tmp_location", 
create_opts="EPSG:3057"):

    print '-'



# create a new mapset in an existing location
with Session(gisdb="/Users/jon/a_tmp", location="a_tmp_location", 
mapset="a_test", create_opts=""):

    print '--'


Jón



On 3 Sep 2018, at 14:49, Moritz Lennert wrote:

> Hi,
>
> A student has been confronted with the following error trying to use 
> grass_session on Mac:
>
> **********************
> from grass_session import Session
>
> GRASSBIN: /Applications/GRASS-$GRASS_MMVER.app/Contents/MacOS
> cmd: /Applications/GRASS-$GRASS_MMVER.app/Contents/MacOS --config path
> out: b''
> err: b'/bin/sh: /Applications/GRASS-.app/Contents/MacOS: No such file 
> or directory\n'
> Traceback (most recent call last):
> File "<pyshell#24>", line 1, in <module>
> from grass_session import Session
> File 
> "/Users/simon/Documents/Stage/Models/WhiteBoxTools/grass_session/__init__.py", 
> line 4, in <module>
> from grass_session.session import (get_platform_name,
> File 
> "/Users/simon/Documents/Stage/Models/WhiteBoxTools/grass_session/session.py", 
> line 259, in <module>
> GISBASE = get_grass_gisbase(grassbin=GRASSBIN)
> File 
> "/Users/simon/Documents/Stage/Models/WhiteBoxTools/grass_session/session.py", 
> line 75, in get_grass_gisbase
> "variable").format(grassbin=grassbin))
> RuntimeError: Cannot find GRASS GIS start script: 
> /Applications/GRASS-$GRASS_MMVER.app/Contents/MacOS, set the right one 
> using the GRASSBIN environm. variable
>
> ************************************
>
> Does anyone have a hint ?
>
> Moritz
>
>
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20180903/9d66da9d/attachment.html>


More information about the grass-user mailing list