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

Glynn Clements glynn at gclements.plus.com
Thu Sep 1 15:49:21 EDT 2011


Johannes Radinger wrote:

> > How did you set GRASS_PYTHON?
> > 
> > AFAIK, it's set in %GISBASE%\etc\env.bat; this will override any
> > global setting.
> 
> 
> I set the environmental variables in the environment settings in the
> system properties as I was told some months ago here in the mailing
> list.

Ah; GRASS_PYTHON is only set in env.bat if it isn't already set. 
PYTHONHOME and PATH are set unconditionally.

> Anyway I found the env.bat file. It contains besides others following
> lines:
> 
> rem Path to the python directory
> set PYTHONHOME=%GISBASE%\Python25
> if "x%GRASS_PYTHON%" == "x" set GRASS_PYTHON=python
> 
> 
> What exactly should be changed there and how should i look like? As I
> said before, the Python I want to be used is C:\Python27\python.exe. 
> As it is set in the environemntal variables do I just need to delete
> it from the env.bat or what shoul I do exactly?

The above should only set GRASS_PYTHON if it isn't already set. 
However, the env.bat file also sets PATH, which may cause the bundled
version to be used in some cases.

If you want to use a system version of Python, I'd suggest disabling
the PYTHONHOME and GRASS_PYTHON settings in env.bat, and removing or
renaming any python.exe/pythonw.exe from the extrabin directory.

The original reason for bundling Python was that the GUI included a
couple of binary components (vdigit and nviz), which would only work
with the specific version of Python against which they were built. 
Those components have since been removed, but currently we don't have
anyone who is able and willing to fix the Window installer.

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


More information about the grass-user mailing list