<div>oops I typed &quot;grass -mx&quot; on email instead of &quot;grass -wx&quot;. Sorry.</div>
<div><br><br> </div>
<div class="gmail_quote">2009/4/29 Milton Cezar Ribeiro <span dir="ltr">&lt;<a href="mailto:miltinho.astronauta@gmail.com">miltinho.astronauta@gmail.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div>Hi Glym,</div>
<div> </div>
<div>Thanks for the reply. I have tryed on two ways, both not work for me (under windows vista).</div>
<div>1) start msys; start grass without -mx ; and try to start python from inside grass sesssion. The python keep stoped (no error message, but stay with only &quot;python&quot; words on the console)</div>
<div> </div>
<div>2) start msys; try to start grass -mx</div>
<div>here I get the following error: </div>
<div>GRASS 6.4.0RC4 &gt; grass65 -wx<br>Cleaning up temporary files ...<br>Starting GRASS ...<br>&#39;import site&#39; failed; use -v for traceback<br>Traceback (most recent call last):<br>  File &quot;c:/OSGeo4W/apps/grass/grass-6.5.svn/etc/wxpython/gis_set.py&quot;, line 23, in &lt;module&gt;<br>
    import os<br>ImportError: No module named os<br>Error in GUI startup. If necessary, please<br>report this error to the GRASS developers.<br>Switching to text mode now.<br>Hit RETURN to continue.. <br><br>Any help are welcome.</div>

<div> </div>
<div>Bests</div>
<div> </div>
<div>milton</div>
<div> </div>
<div> </div>
<div class="gmail_quote">2009/4/29 Glynn Clements <span dir="ltr">&lt;<a href="mailto:glynn@gclements.plus.com" target="_blank">glynn@gclements.plus.com</a>&gt;</span> 
<div>
<div></div>
<div class="h5"><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div><br>Milton Cezar Ribeiro wrote:<br><br>&gt; I started grass under Msys and with the flag -wx.<br>&gt; My difficult now I how can I get starting, with a simple example, like<br>&gt; these on the grass-python page:<br>
<br></div>
<div>&gt; My question is how can I make python find the &quot;grass&quot; to run the import.<br>&gt; I need to start python inside a MSYS -&gt; GRASS session, like R do?<br><br></div>In order to find grass.py, PYTHONPATH needs to include<br>
$GISBASE/etc/python. This is done automatically when you start GRASS.<br><br>However, the functions in grass.py run GRASS commands, and so require<br>the usual GRASS environment (GISBASE, GISRC, etc). So you need to<br>either run the Python script from within a GRASS session, or set up<br>
the GRASS environment by some other means.<br><br>If you want to write a stand-alone program, you could always have the<br>Python script set up the GRASS environment, e.g. from registry keys<br>(or if this is for your own use, just hard-code everything). You can<br>
add directories to the path used for importing Python modules by<br>modifying sys.path, e.g.:<br><br>       import sys<br>       ...<br>       gisbase = os.normpath(os.environ[&#39;GISBASE&#39;])<br>       pydir = os.path.join(gisbase, &quot;etc&quot;, &quot;python&quot;)<br>
       sys.path.append(pydir)<br><br>You still need to figure out how to determine the database, location,<br>and mapset, though.<br><font color="#888888"><br>--<br>Glynn Clements &lt;<a href="mailto:glynn@gclements.plus.com" target="_blank">glynn@gclements.plus.com</a>&gt;<br>
</font></blockquote></div></div></div><br></blockquote></div><br>