<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Hi devs,</p>
<p>I am trying to create a new mapset and open that mapset using
g.mapset. When doing this from the command line, I can import
layers in the new mapset using r.in.gdal without problems.However,
running this in a python script doesn't work. E.g., when I run:</p>
<p><br>
</p>
<pre>gs.run_command("g.mapset", flags="c", mapset="LST", location="latlon_clark66")</pre>
<p><br>
</p>
<p>Next, I try to import a layer:</p>
<p><br>
</p>
<pre>infile="lst_01.tif"</pre>
<pre>outfile="lst_01"</pre>
<pre>gs.run_command("r.in.gdal", input=infile, output=outfile)</pre>
<pre>
</pre>
This gives me the error:
<pre>
</pre>
<pre>gs.run_command("r.in.gdal", input="lst_01.tif", output="lst_01")</pre>
<pre>Traceback (most recent call last):</pre>
<pre>
File "<ipython-input-18-2c415e16d79f>", line 1, in <module></pre>
<pre> gs.run_command("r.in.gdal", input="lst_01.tif", output="lst_01")</pre>
<pre>
File "/usr/local/grass7/grass-7.5.svn/etc/python/grass/script/core.py", line 421, in run_command</pre>
<pre> return handle_errors(returncode, returncode, args, kwargs)</pre>
<pre>
File "/usr/local/grass7/grass-7.5.svn/etc/python/grass/script/core.py", line 332, in handle_errors</pre>
<pre> returncode=returncode)</pre>
<pre>
CalledModuleError: Module run None ['r.in.gdal', 'input=lst_01.tif', 'output=lst_01'] ended with error</pre>
<pre>Process ended with non-zero return code 1. See errors in the (error) output.</pre>
<p><br>
</p>
<p>Any idea why this doesn't work? <br>
</p>
<p>Best wishes,</p>
<p>Paulo<br>
</p>
<p><br>
</p>
</body>
</html>