[GRASS-dev] Re: [GRASS-user] ImportError: No module named lib

[CC to grass-dev]

Rusiru Boteju wrote:

i get this
"ImportError: No module named lib"
when i try to run the code in http://grass.osgeo.org/wiki/GRASS_and_Python#Python-SWIG_examples
can any one help me :frowning:

First, ensure that you don't have a file named grass.py in the current
directory (e.g. ensure that the swig/python directory isn't the
current directory).

Python always checks the current directory before $PYTHONPATH, so it
gets confused if the current directory contains a module with the same
name as a package.

I'm wondering whether grass.lib.grass (i.e. the bindings for libgis)
should be renamed (to e.g. gis, general, or core) to avoid confusion.

--
Glynn Clements <glynn@gclements.plus.com>

On Mon, Oct 19, 2009 at 3:22 PM, Glynn Clements
<glynn@gclements.plus.com> wrote:

[CC to grass-dev]

Rusiru Boteju wrote:

i get this
"ImportError: No module named lib"
when i try to run the code in http://grass.osgeo.org/wiki/GRASS_and_Python#Python-SWIG_examples
can any one help me :frowning:

...

I'm wondering whether grass.lib.grass (i.e. the bindings for libgis)
should be renamed (to e.g. gis, general, or core) to avoid confusion.

"core" for libgis seems to make a lot of sense.
So: grass.lib.core

Markus