Tag Archives: GRASS

‘Fixing’ GRASS

I use Ubuntu as my operating system and have GRASS GIS installed through the ubuntugis-unstable repository. Everything has been working great. Then I installed the landsat-util tool and all sorts of ‘stuff’ started getting installed and updated. I know I should have kept an eye on what it was going to do but I was in a rush and just said ‘Y’ whenever prompted. Bad practice. Anyway, the upshot was that landsat-util installed and worked perfectly, but GRASS GIS fell over. It would not load the GUI. Damn!

The message I was getting was something along the lines of

This module requires the Numeric/numarray or NumPy module, which could not be imported. It probably is not installed
(it's not part of the standard Python distribution). See the Numeric Python site (http://numpy.scipy.org) for information on
downloading source or binaries.
ImportError: Numeric,numarray or NumPy not found.

When I checked in Python, I had numpy installed, so that wasn’t the issue.

I couldn’t find anything useful online to help me fix it but then I thought, it’s Python and it’s open source. Let’s have a hack!

I opened the following file (if I was more leet I would have used vim or nano or something):

sudo geany /usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode/wx/lib/plot.py


I then went to line 117 and added the first three lines shown in the code block below, remembering to alter all the indents etc:

try:
    import numpy as _Numeric
except:
    try:
    import numpy.oldnumeric as _Numeric
    except:
        try:
            import numarray as _Numeric #if numarray is used it is renamed Numeric
        except:
            try:
                import Numeric as _Numeric
            except:
                msg= """
This module requires the Numeric/numarray or NumPy module,
which could not be imported. It probably is not installed
(it's not part of the standard Python distribution). See the
Numeric Python site (http://numpy.scipy.org) for information on
downloading source or binaries."""
                raise ImportError, "Numeric,numarray or NumPy not found. \n" + msg

 

I then saved the file and restarted GRASS and it all (seems) to be running smoothly and as it should do.

Disclaimer: Now I’m no programmer, just a hacker of code and general tinkerer. Your mileage may vary, but if this is of use to anyone then that’s great. It’s of use to me and that’ll do me fine.

Advertisements
Tagged , ,

GRASS AddOns

See http://grass.osgeo.org/wiki/GRASS_AddOns to see a list of available add ons for GRASS. This includes lots of raster analysis tools including wavelets: http://grass.osgeo.org/wiki/GRASS_AddOns#r.wavelets

Tagged , ,