1

I installed GRASS GIS 6.4.3 on Ubuntu Precise 12.04 by sudo apt-get install grass grass-doc, as recommended by the Wiki. It runs with the wxpython GUI, but when I use any command (like r.in.gdal or v.digit etc.) from the command line, i get the exception:

Traceback (most recent call last):
    File "/usr/lib/grass64/etc/wxpython/gui_core/forms.py", line 69, in <module>
    from core import globalvar
    ImportError: cannot import name globalvar

I opened the python interpreter (actually running python 2.7.3) and tried to import core; that works but, in fact, there's no module globalvar under core. I am able to use all grass commands from the GUI, but the same commands raise the ImportError exception if run by the command line. This happens only when starting GRASS with the wxpython GUI, not with the Tcl/Tk one. I assume that GRASS looks for globalvar in the main core package rather than in the wxpython.core one.

1

I found a workaround for that issue. Modifying file $GISBASE/etc/wxpython/gui_core/forms.py at line 67, substitute sys.path.append(wxbase) with sys.path.insert(0,wxbase). This way python puts the path to wxpython's core package at the beginning of sys.path, so that the first core package found is the correct one. Did somebody else experience the same issue?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.