<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/xhtml; charset=utf-8">
</head>
<body>
<div style="font-family:sans-serif"><div style="white-space:normal">
<p dir="auto">Hi again, - replace the python script with the following (apologies version confusion):</p>

<h1 style="font-size:1.4em">!/usr/bin/env python</h1>

<h1 style="font-size:1.4em">-<em>- coding:utf-8 -</em>-</h1>

<p dir="auto">from grass.script import core as grass<br>
from grass.script import db as grass</p>

<p dir="auto">from grass_session import Session<br>
from grass.script import core as gcore</p>

<h1 style="font-size:1.4em">create a new location from EPSG code</h1>

<p dir="auto">with Session(gisdb="/Users/jon/a_tmp", location="a_tmp_location", create_opts="EPSG:3057"):</p>

<p dir="auto">print '-'</p>

<h1 style="font-size:1.4em">create a new mapset in an existing location</h1>

<p dir="auto">with Session(gisdb="/Users/jon/a_tmp", location="a_tmp_location", mapset="a_test", create_opts=""):</p>

<p dir="auto">print '--'</p>

<p dir="auto">Jón</p>

<p dir="auto">On 3 Sep 2018, at 14:49, Moritz Lennert wrote:</p>

</div>
<div style="white-space:normal"><blockquote style="border-left:2px solid #777; color:#777; margin:0 0 5px; padding-left:5px"><p dir="auto">Hi,<br>
<br>
A student has been confronted with the following error trying to use grass_session on Mac:<br>
<br>
**********************<br>
from grass_session import Session<br>
<br>
GRASSBIN: /Applications/GRASS-$GRASS_MMVER.app/Contents/MacOS<br>
cmd: /Applications/GRASS-$GRASS_MMVER.app/Contents/MacOS --config path<br>
out: b''<br>
err: b'/bin/sh: /Applications/GRASS-.app/Contents/MacOS: No such file or directory\n'<br>
Traceback (most recent call last):<br>
File "<pyshell#24>", line 1, in <module><br>
from grass_session import Session<br>
File "/Users/simon/Documents/Stage/Models/WhiteBoxTools/grass_session/__init__.py", line 4, in <module><br>
from grass_session.session import (get_platform_name,<br>
File "/Users/simon/Documents/Stage/Models/WhiteBoxTools/grass_session/session.py", line 259, in <module><br>
GISBASE = get_grass_gisbase(grassbin=GRASSBIN)<br>
File "/Users/simon/Documents/Stage/Models/WhiteBoxTools/grass_session/session.py", line 75, in get_grass_gisbase<br>
"variable").format(grassbin=grassbin))<br>
RuntimeError: Cannot find GRASS GIS start script: /Applications/GRASS-$GRASS_MMVER.app/Contents/MacOS, set the right one using the GRASSBIN environm. variable<br>
<br>
************************************<br>
<br>
Does anyone have a hint ?<br>
<br>
Moritz<br>
<br>
<br>
_______________________________________________<br>
grass-user mailing list<br>
grass-user@lists.osgeo.org<br>
<a href="https://lists.osgeo.org/mailman/listinfo/grass-user" style="color:#777">https://lists.osgeo.org/mailman/listinfo/grass-user</a></p>
</blockquote></div>
<div style="white-space:normal">
</div>
</div>
</body>
</html>