[GRASS-dev] forcing a Python version/install when compiling GRASS

Glynn Clements glynn at gclements.plus.com
Fri Feb 20 18:27:12 PST 2015


Yann Chemin wrote:

> I would like to use a different version of Python from the default install in the PC,
> is there a way to force it in the configure script?

No.

You can control the interpreter used for building by overriding the
PYTHON make variable, e.g.

	make PYTHON=/path/to/python ...

For controlling the interpreter used at run time:

On Windows, Python scripts are invoked via %GRASS_PYTHON%, so changing
that environment variable will change the interpreter.

On Unix, GRASS_PYTHON is only used for components which use wxPython,
e.g. wxGUI or the parameter dialogs which are displayed when modules
are run without arguments.

Scripts rely upon the "#!/usr/bin/env python" line. You can control
the interpreter used by scripts by creating a directory containing a
symlink named "python" which refers to your preferred version of the
interpreter, and placing that directory at the front of $PATH.

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


More information about the grass-dev mailing list