[GRASS-dev] Fwd: [GRASS-user] How to embed a grass script (for example v.db.addcol) into a Pythonscript on windows?

Michael Barton Michael.Barton at asu.edu
Wed Mar 17 18:40:32 EDT 2010


Glynn,

A couple of students are trying to run python in wingrass now, following your directions below. They installed python, but we're not sure where to put #4 in your steps.

>> 4. PYTHONPATH needs to be set to %WINGISBASE%\etc\python


It seems like it ought to go into the "grass64svn" initialization file

That file has the following lines...

PYTHONPATH="$GISBASE/etc/python:$GISBASE/Python25:$PYTHONPATH"
export PYTHONPATH
PYTHONHOME="C:\Program Files\GRASS-64-SVN\Python25"

Does it go there? With quotes? What about changing PYTHONHOME?

Is this the wrong place?

When we've changed the PYTHONPATH line in grass64svn and tried to run python from the msys prompt in GRASS, nothing happens. That is, the prompt goes away and returns a blank line. You can type on that line, but nothing returns.

What are we missing?

Thanks
Michael
____________________
C. Michael Barton
Director, Center for Social Dynamics & Complexity 
Professor of Anthropology, School of Human Evolution & Social Change
Arizona State University

voice: 	480-965-6262 (SHESC), 480-727-9746 (CSDC)
fax:          480-965-7671 SHESC),  480-727-0709 (CSDC)
www: www.public.asu.edu/~cmbarton, http://csdc.asu.edu









Begin forwarded message:

>> From: Glynn Clements <glynn at gclements.plus.com>
>> Date: March 4, 2010 2:48:49 PM MST
>> To: Michael Barton <Michael.Barton at asu.edu>
>> Cc: grass-user grass-user <grass-user at lists.osgeo.org>, GRASS developers list <grass-dev at lists.osgeo.org>
>> Subject: Re: [GRASS-user] How to embed a grass script (for example v.db.addcol) into a Pythonscript on windows?
>> 
>> 
>> Michael Barton wrote:
>> 
>>> This implies that it is now possible to create python scripts that run in GRASS under windows??? 
>>> 
>>> That would be great news. Is there anything special that is needed for this to work?
>> 
>> 1. The Python interpreter (python.exe) needs to be in the PATH
>> 2. Python needs to be associated with the .py extension
>> 3. PATHEXT needs to include .py if you want to be able to omit the extension
>> 4. PYTHONPATH needs to be set to %WINGISBASE%\etc\python
>> 
>> 1-3 should be taken care of by the Python installer. 4 needs to be
>> done by the startup (currently, this doesn't appear to be the case on
>> Windows).
>> 
>> -- 
>> Glynn Clements <glynn at gclements.plus.com>
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-dev/attachments/20100317/518a8176/attachment-0001.html


More information about the grass-dev mailing list