[GRASS-dev] python2/3 and GRASS build on Arch

Maciej Sieczka msieczka at sieczka.org
Sun Oct 5 06:44:49 PDT 2014

W dniu 04.01.2013 o 00:13, Glynn Clements pisze:
> Maciej Sieczka wrote:

>>> The python interpreter is accessed via the make variable PYTHON, so
>>> you can use e.g.:
>>> make PYTHON=python2

>> Still one error crops out - ctypesgen.py has "#!/usr/bin/env python"
>> shebang, which calls Python 3.x on Arch, therefore:
>> Changing that shebang to python2 let the build complete OK. Do you know
>> if there is a workaround which does not involve modyfying the source though?

> Create a directory containing a symlink from "python" to the python2
> executable, than add that directory to the front of the PATH.

I have successfully aplied this approach (symlink `python2' in the root 
of releasebranch_7_0 working copy as `python', add that dir to the front 
of the PATH, export PATH, run `make') until recently I started getting 
the following error during build:

$ pwd

$ make
make[1]: Entering directory 
--html-description < /dev/null | grep -v '</body>\|</html>' > 
Traceback (most recent call last):
line 54, in <module>
     import  wx
ImportError: No module named 'wx'
../../../include/Make/GuiScript.make:36: recipe for target 
'g.gui.iclass.tmp.html' failed
make[1]: *** [g.gui.iclass.tmp.html] Error 1
rm g.gui.iclass.tmp.html
make[1]: Leaving directory 
../../../include/Make/GuiScript.make:22: recipe for target 'guiscript' 
make: *** [guiscript] Error 2

I can `import wx' without issue on `python2' shell, but not on `python3' 
shell, so it seems to me the error above is due to Python 3 being used 
instead of Python 2, in spite of the symlink "hack".

Every other GRASS 7 Python thing builds fine though. Why is iclass build 
trying to use Python 3? How should deal with this, the least intrusive way?


Maciej Sieczka

More information about the grass-dev mailing list