<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<br>
<div class="moz-forward-container"> Dear list,<br>
I am struggling with my python code.<br>
I am trying to get the computational region of a xyz-file. If I
use r.in.xyz in GRASS itself, it works all just fine, but using it
in python I always get an error.<br>
Here is my code:<br>
<br>
<blockquote>from grass_session import Session<br>
from grass.script import core as gcore<br>
from grass.pygrass.modules.shortcuts import general as g<br>
from grass.pygrass.modules.shortcuts import raster as r<br>
<br>
with Session(gisdb="/home/jreith/grassdata",
location="nrw",mapset="elevation", create_opts="EPSG:4326"):<br>
compregion = gcore.parse_command('r.in_xyz',
input="/geodaten/dgm1.xyz", flags='s',
output="new_file",separator='space')<br>
</blockquote>
<br>
The error:<br>
<br>
<blockquote>Traceback (most recent call last):<br>
File "grass_scripts/grass_dem.py", line 32, in <module><br>
compregion = gcore.parse_command('r.in_xyz',
input="/geodaten/dgm1.xyz", flags='s',
output="new_file",separator='space')<br>
File
"/home/jreith/source/grass-7.4.svn/dist.x86_64-pc-linux-gnu/etc/python/grass/script/core.py",
line 516, in parse_command<br>
res = read_command(*args, **kwargs)<br>
File
"/home/jreith/source/grass-7.4.svn/dist.x86_64-pc-linux-gnu/etc/python/grass/script/core.py",
line 471, in read_command<br>
process = pipe_command(*args, **kwargs)<br>
File
"/home/jreith/source/grass-7.4.svn/dist.x86_64-pc-linux-gnu/etc/python/grass/script/core.py",
line 444, in pipe_command<br>
return start_command(*args, **kwargs)<br>
File
"/home/jreith/source/grass-7.4.svn/dist.x86_64-pc-linux-gnu/etc/python/grass/script/core.py",
line 380, in start_command<br>
return Popen(args, **popts)<br>
File
"/home/jreith/source/grass-7.4.svn/dist.x86_64-pc-linux-gnu/etc/python/grass/script/core.py",
line 74, in __init__<br>
subprocess.Popen.__init__(self, args, **kwargs)<br>
File "/usr/lib/python2.7/subprocess.py", line 711, in __init__<br>
errread, errwrite)<br>
File "/usr/lib/python2.7/subprocess.py", line 1343, in
_execute_child<br>
raise child_exception<br>
OSError: [Errno 2] No such file or directory<br>
</blockquote>
I appreciate any help and hope I made myself clear.<br>
<br>
best regards<br>
Jonathan<br>
<br>
</div>
</body>
</html>