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

2 messages Options
Embed this post
Permalink
Glynn Clements

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

Reply Threaded More More options
Print post
Permalink

[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 <[hidden email]>
_______________________________________________
grass-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-dev
Markus Neteler

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

Reply Threaded More More options
Print post
Permalink
On Mon, Oct 19, 2009 at 3:22 PM, Glynn Clements
<[hidden email]> 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 :(
...
> 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
_______________________________________________
grass-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-dev