[GRASS-user] Re: [GRASS-windows] WinGRASS Python 2.7

Johannes Radinger JRadinger at gmx.at
Tue Sep 6 07:44:14 EDT 2011


Hi again,


sorry for posting again, but somehow I can't get it work to
run GRASS GIS using my local Python 2.7 installation.
See comments below:

-------- Original-Nachricht --------
> Datum: Mon, 5 Sep 2011 01:57:38 +0100
> Von: Glynn Clements <glynn at gclements.plus.com>
> An: "Johannes Radinger" <JRadinger at gmx.at>
> CC: grass-user at lists.osgeo.org, grass-windows at lists.osgeo.org
> Betreff: Re: [GRASS-user] Re: [GRASS-windows] WinGRASS Python 2.7

> 
> Johannes Radinger wrote:
> 
> > As recommended I did the changes.
> > I just tried to first disable the PYTHONHOME and
> > GRASS_PYTHON. The lines in the env.bat file are now:
> > 
> > rem Path to the python directory
> > rem set PYTHONHOME=%GISBASE%\Python25
> > rem if "x%GRASS_PYTHON%" == "x" set GRASS_PYTHON=python
> > 
> > is that correct?
> > 
> > 
> > I tried at this step to start GRASS but it doesn't work
> > anymore. Nothing is started!! So it seems that this isn't
> > working! Maybe I have to set the path to python.org in the
> > env.bat, but I don't know how the lines should look like.
> 
> For the GUI, setting e.g.:
> 
> 	set GRASS_PYTHON=c:\Program Files (x86)\Python27\pythonw.exe
> 
> should suffice.

So what I tried now were three different settings in the env.bat

1)
rem Path to the python directory
set PYTHONHOME=%GISBASE%\Python25
rem if "x%GRASS_PYTHON%" == "x" set GRASS_PYTHON=python
set GRASS_PYTHON=C:\Program Files (x86)\Python27\pythonw.exe

in this case: GRASS is starting using the Python25

2)
rem Path to the python directory
rem set PYTHONHOME=%GISBASE%\Python25
rem if "x%GRASS_PYTHON%" == "x" set GRASS_PYTHON=python
set GRASS_PYTHON=C:\Program Files (x86)\Python27\pythonw.exe

in this case: Nothing is started!

3)
rem Path to the python directory
rem set PYTHONHOME=%GISBASE%\Python25
rem if "x%GRASS_PYTHON%" == "x" set GRASS_PYTHON=python
set C:\Program Files (x86)\Python27
set GRASS_PYTHON=C:\Program Files (x86)\Python27\pythonw.exe

in this case: Nothing is started!


Just to inform you why I need that: I wrote a .py script (including g.parser elements) which I want to call inside GRASS with "file.py" (like any other modules e.g. r.fuzzy etc.) The script is working (tested on my Mac using GRASS in combination with Python 2.7)! The script calls scipy which can only be used in combination with Python 2.6 or newer (so far as I remember).


So hopefully this issue can be solved as soon as possible as I want to use the script also on my windows-office computer!!

Thank you
Johannes






> 
> If you want to run Python scripts from bash, you may run into problems
> if there are any spaces in any of the directories. Using an 8.3
> filename may work, e.g.:
> 
> 	export PATH=$PATH:/c/PROGRA~2/Python27/pythonw.exe
> 
> Running Python scripts from cmd.exe should use the file association
> for the .py extension.
> 
> -- 
> Glynn Clements <glynn at gclements.plus.com>
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user

-- 
NEU: FreePhone - 0ct/min Handyspartarif mit Geld-zurück-Garantie!		
Jetzt informieren: http://www.gmx.net/de/go/freephone


More information about the grass-windows mailing list