Vaclav Petras wrote: > > Even if you can load the library, you probably aren't going to be able > > to do much with it unless GISRC is set. > > I hoped that this is what `grass.script.setup.init` is doing.
Fair enough. However, that's going to be subject to a number of of chicken-and-egg problems, of which LD_LIBRARY_PATH is only one (e.g. on Windows with a "bundled" Python interpreter, running a Python script from outside GRASS is going to use the system Python, not the bundled Python). The safe solution is to first set up all of the environment variables for a GRASS "session" then execute the "real" script with e.g. os.execv(). That should eliminate any issues with changes to environment variables not taking effect. It should also ensure that the real script is executed using any bundled Python. To be honest, I'm not sure that setup.py belongs in lib/python. lib/init (alongside grass.py) seems more appropriate, as it's widely understood that any code in that directory can't rely upon the usual GRASS features. -- Glynn Clements <[email protected]> _______________________________________________ grass-dev mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/grass-dev
