[GRASS-dev] [GRASS GIS] #2591: error in grass.sh selecting python version

GRASS GIS trac at osgeo.org
Thu Feb 19 05:42:09 PST 2015


#2591: error in grass.sh selecting python version
-----------------------+----------------------------------------------------
 Reporter:  foret37    |       Owner:  grass-dev@…              
     Type:  defect     |      Status:  new                      
 Priority:  normal     |   Milestone:  7.0.0                    
Component:  Default    |     Version:  unspecified              
 Keywords:             |    Platform:  Unspecified              
      Cpu:  OSX/Intel  |  
-----------------------+----------------------------------------------------
 I am running Grass 7.0.0RC1 on a Mac OSX 10.10.2. I launched the program
 using the Grass app, and it failed with an error.

 I then ran the script directly in the term, in order to see the error.

 > cd /Applications/GRASS/GRASS-7.0.app/Contents/MacOS/
 > ./grass.sh
 Rebuilding Addon HTML manual pages index...
 Rebuilding Addon menu...
 Python 2.7.9 found.
 arch: posix_spawnp: /opt/local/bin/pythonw2.7: Bad CPU type in executable

 This problem is well known, and has to do with the selection of the wrong
 version of python, as discussed at
 http://grasswiki.osgeo.org/wiki/MacOSX_GRASS_errors.
 Some sluthing showed that grass.sh selects a link in my MacPorts
 directory, /opt/local/bin, that points to the native Apple version of
 python.
 I followed the instructions at MacOSX_GRASS_errors and added the following
 environment variables:
 export GRASS_PYTHON=/usr/bin/python2.6
 export GRASS_PYTHONWX=/usr/bin/pythonw2.6
 but that did not fix the problem (same errors).
 After a lot of messing around, I found that I can get grass started by
 placing the directory with the right version of python as first in the
 path string:
 export PATH="/usr/bin:$PATH"
 Grass launches now, regardless of the status of the GRASS_PYTHON and
 GRASS_PYTHONWX variables.
 My casual reading of the grass.sh script suggests that it never checks
 GRASS_PYTHONWX to see if it has a value.
 That issue suggests that the solution to the problem is add a check for
 GRASS_PYTHONWX.

 One other issue that seems odd: Grass does not remember my initial
 settings. In other words, each time I login, it goes through the questions
 for a new user.

-- 
Ticket URL: <http://trac.osgeo.org/grass/ticket/2591>
GRASS GIS <http://grass.osgeo.org>



More information about the grass-dev mailing list