[GRASS-user] g.extension - ERROR: G_getenv(): Variable LOCATION_NAME not set

Hamish hamish_b at yahoo.com
Wed Feb 8 01:52:44 EST 2012


Eric wrote:
> Not sure if I should be sending this to the mail list or
> reporting it as a bug?  Seems I am doing everything right,
> but I still have a lot to learn.  I hope I am missing something
> easy???

usually a bug report would be good, but g.extension is still
a work in progress, so the mailing list is fine too.

 
> I want to add some extensions for all users on a shared
> virtual machine (Gnome, Debian, GRASS 6.4.2RC3 (2012) ).
>  I have run gksudo 'grass64 -gui'

I would hesitate to run GRASS as root. You might make it the
owner of some files or a mapset which belongs to a regular user.
(maybe set up an admin account to look after the PERMANENT mapset
in a multi-user location?)

> and used the GUI for g.extension to install an
> extension system wide.  Below is the error I
> received.

simple work-around first: run g.extension as your regular user
and then sudo copy the resulting binary from $GRASS_ADDON_PATH
into $GISBASE/bin/. done! (make sure it is chmod a+rx)

>  I checked the environment settings, and the
> variable LOCATION_NAME is set.
> 
> I then tried the Download Source option -it did download the
> i.landsat.toar file,

(note i.landsat.toar is now in the grass 6.5 source code too)

> but neither of the listed commands in
> the output would work. (The second set of output for this
> attempt.)
> 
> If there isn't a quick answer, would it be easier to just
> run from source with GRASS 7?

note i.landsat.toar is present in grass 6.5svn too.
(and don't use trunk for work that really matters; it's
experimental)

> We are currently all logging into the same virtual machine,
> so the admin efficiency of being able to deploy a package
> isn't a big issue.
> 
> Any suggestions?  Thanks,

try g.extension from the command prompt, it's a different version
than the one which runs from the GUI. Specifically it has a -s
flag to install system-wide (same as the GUI version), but also
a -u flag to install system-wide using sudo for the install step. AFAIK these are not terribly well tested so any feedback would
be appreciated.


> ERROR: G_getenv(): Variable LOCATION_NAME not set

this generally happens because it didn't think you were in grass
at the time.


if you installed from .deb packages, make sure the grass-dev
package is installed too.

if you installed from source you can copy the i.landsat.toar
source code dir into the imagery/ dir in the grass source code,
then run "make" from in there.


Hamish


More information about the grass-user mailing list