[GRASS-windows] Fwd: WinGRASS installation and addtional python modules

Johannes Radinger JRadinger at gmx.at
Tue May 17 09:06:15 EDT 2011


-------- Original-Nachricht --------
> Datum: Tue, 17 May 2011 13:00:58 +0100
> Von: Glynn Clements <glynn at gclements.plus.com>
> An: "Johannes Radinger" <JRadinger at gmx.at>
> CC: grass-windows at lists.osgeo.org
> Betreff: Re: [GRASS-windows] Fwd: WinGRASS installation and addtional python	modules

> 
> Johannes Radinger wrote:
> 
> > Probably that is better for the wingrass mailing list then for the
> > general grass-user list:
> > 
> > I wrote a python script for grass involving several python modules
> > (numpy, scipy and matplotlib) and I tested it successfully on my mac
> > osx (GRASS GIS 6.5, Python 2.6.6 and other modules).
> > 
> > Now I'd like to test it on a Windows 7 machine and need to install all
> > the necessary python modules. So my question: Which python version
> > (2.6.6 or 2.7) should be installed and which version of wingrass
> > (script should work on all recent versions of grass). Will Wingrass
> > use the before installed python (either 2.6.6 or 2.7) and its
> > addtional modules?
> > 
> > What is the simpliest way to make this combination working? Just
> > install everthing?
> 
> Use whichever version of Python you want, but be sure to eliminate all
> traces of the Python version which gets bundled with WinGRASS
> (including removing any references from environment variables set by
> Init.bat).
> 
> Once you have a proper Python installation, the only connections
> between GRASS and Python should be:
> 
> 1. GRASS_PYTHON should be set to the complete path to the Python
> interpreter. This is used for running wxPython code, e.g. from g.gui
> or when running a command without arguments (or with the --ui flag)
> displays a parameter dialog.
> 
> 2. PYTHONPATH needs to contain %GISBASE%\etc\python so that e.g. 
> "import grass.script" can find the module.


Okay so what I've done now is:

1) Installed Python 2.7
2) Installed addtional Python modules (Numpy, Scipy, Matplotlib)
3) Installed WinGRASS 6.4.1 (recent package for Windows)
4) Created following environmental variables:
   GRASS_PYTHON C:\Python27\python
   PYTHONPATH  %GISBASE%\etc\python
5) Restarted Windows (don't know if needed)

Now two questions
1) Is everything done correctly and how can I check it (GRASS works, but how to check if grass can access the python modules (Scipy)?
2) Where do I have to store my python-script to call it from GRASS (bin folder in the lib in Mac OS)?

/Johannes



> 
> -- 
> Glynn Clements <glynn at gclements.plus.com>

-- 
NEU: FreePhone - kostenlos mobil telefonieren und surfen!			
Jetzt informieren: http://www.gmx.net/de/go/freephone


More information about the grass-windows mailing list