<div dir="ltr">On Tue, Oct 27, 2015 at 3:53 PM, Pedro Venâncio <<a href="mailto:pedrongvenancio@gmail.com">pedrongvenancio@gmail.com</a>> wrote:<br>> Hi Veronica,<br>><br>> Did you install GRASS in OSGeo4W? Which version?<br>> On Sunday I made an installation on Windows and I found a problem. GRASS<br>> 7.0.2RC is already available on OSGeo4W. However, the .bat file that is<br>> created for the use of GRASS7 with QGIS, does not work, because it points to<br>> the folder structure of GRASS 7.0.1.<br><br>Hi Pedro:<br>I'm not on the QGIS list, please forward to them that they would better use this approach to get the path rather than hardocing it:<br><br>grass70 --config path<br><br>If they need Python, they could use something like this:<br><br><a href="https://grasswiki.osgeo.org/wiki/Working_with_GRASS_without_starting_it_explicitly#Python:_GRASS_GIS_7">https://grasswiki.osgeo.org/wiki/Working_with_GRASS_without_starting_it_explicitly#Python:_GRASS_GIS_7</a><span class=""></span><span class=""></span><br><br><pre class=""><span class=""># query GRASS 7 itself for its GISBASE</span>
startcmd <span class="">=</span> <span class="">[</span>grass7bin<span class="">,</span> <span class="">'--config'</span><span class="">,</span> <span class="">'path'</span><span class="">]</span>
p <span class="">=</span> <span class="">subprocess</span>.<span class="">Popen</span><span class="">(</span>startcmd<span class="">,</span> shell<span class="">=</span><span class="">False</span><span class="">,</span>
stdout<span class="">=</span><span class="">subprocess</span>.<span class="">PIPE</span><span class="">,</span> stderr<span class="">=</span><span class="">subprocess</span>.<span class="">PIPE</span><span class="">)</span>
out<span class="">,</span> err <span class="">=</span> p.<span class="">communicate</span><span class="">(</span><span class="">)</span>
<span class="">if</span> p.<span class="">returncode</span> <span class="">!=</span> <span class="">0</span>:
<span class="">print</span> <span class="">>></span><span class="">sys</span>.<span class="">stderr</span><span class="">,</span> <span class="">"ERROR: Cannot find GRASS GIS 7 start script (%s)"</span> % startcmd
<span class="">sys</span>.<span class="">exit</span><span class="">(</span>-<span class="">1</span><span class="">)</span>
gisbase <span class="">=</span> out.<span class="">strip</span><span class="">(</span><span class="">'<span class="">\n</span><span class="">\r</span>'</span><span class="">)</span>
<span class=""># Set GISBASE environment variable</span>
<span class="">os</span>.<span class="">environ</span><span class="">[</span><span class="">'GISBASE'</span><span class="">]</span> <span class="">=</span> gisbase
<span class=""># the following not needed with trunk</span>
<span class="">os</span>.<span class="">environ</span><span class="">[</span><span class="">'PATH'</span><span class="">]</span> +<span class="">=</span> <span class="">os</span>.<span class="">pathsep</span> + <span class="">os</span>.<span class="">path</span>.<span class="">join</span><span class="">(</span>gisbase<span class="">,</span> <span class="">'extrabin'</span><span class="">)</span>
<span class=""># add path to GRASS addons</span>
home <span class="">=</span> <span class="">os</span>.<span class="">path</span>.<span class="">expanduser</span><span class="">(</span><span class="">"~"</span><span class="">)</span>
<span class="">os</span>.<span class="">environ</span><span class="">[</span><span class="">'PATH'</span><span class="">]</span> +<span class="">=</span> <span class="">os</span>.<span class="">pathsep</span> + <span class="">os</span>.<span class="">path</span>.<span class="">join</span><span class="">(</span>home<span class="">,</span> <span class="">'.grass7'</span><span class="">,</span> <span class="">'addons'</span><span class="">,</span> <span class="">'scripts'</span><span class="">)</span>
</pre><br><br>Best<br>Markus</div>