[GRASS-dev] python with grass

Markus Neteler neteler at osgeo.org
Sat Jun 6 02:00:23 EDT 2009


On Thu, Jun 4, 2009 at 7:56 PM, Danho Fursy Rodelec
Neuba<danho_f at yahoo.fr> wrote:
> Hy everybody,
> this is me again. Bound_box work very well and i am  happy. I need to
> know something new. When I can launch my program directly in grass using
> python test.py there is this error message:
>  File "test.py", line 4, in <module>
>    from grass.lib import grass as gl6
> ImportError: No module named lib
> When I am in  python environment it is possible to import grass from
> grass.lib. Can you tell me why i got this error.

Just for the record of the list archive (since you found out
already):

import sys
sys.path.append("/usr/local/grass-6.4.0svn/etc/python")
from grass.lib import grass
import random
grass.G_gisinit('')
...


Markus


More information about the grass-dev mailing list