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

Glynn Clements glynn at gclements.plus.com
Mon Oct 19 09:22:28 EDT 2009


[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 :(

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 at gclements.plus.com>


More information about the grass-dev mailing list