It fails because "/etc/python/grass" isn't referenced as a package without the __init__.py.
2009/6/18 Martin Landa <[email protected]>: > Hi, > > 2009/6/18 Glynn Clements <[email protected]>: >>> >> etc/python/grass/__init__.py shouldn't contain "import lib" - it's >>> >> bug. >>> > >>> > Commenting "import lib" soved it. >>> >>> OK, anyway it's wrong that this line was written to __init__.py when >>> compilation of Python Swig failed. >> >> IMHO, this line shouldn't be written in either case. Code wishing to >> use the SWIG bindings should explicitly use "import grass.lib". Or, >> preferably, import "grass.lib.grass" etc. Loading a dozen libraries >> "just in case" is a waste of resources and a potential source of >> errors. >> >> Actually, I see no reason for grass/__init__.py to exist. Code can >> just import grass.script or grass.lib or both as required. > > probably I misunderstand, but if I remove __init__.py, import fails, e.g. > >>>> import grass.script as grass > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > ImportError: No module named grass.script > > Martin > > -- > Martin Landa <landa.martin gmail.com> * http://gama.fsv.cvut.cz/~landa > _______________________________________________ grass-user mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/grass-user
