[GRASS-dev] Calling GRASS from outside: cannot open shared object file

Glynn Clements glynn at gclements.plus.com
Tue May 13 13:23:07 PDT 2014


Markus Neteler wrote:

> I tried my current start-python-and-create-a-location script on Windows.
> The location is generated but then a call of the scripting library fails
> with a gettext error (I print the os.environment to understand more but no
> idea):

> "C:\OSGeo4W\apps\grass\grass-7.1.svn\etc\python\grass\script\core.py", line 38, in <module>
>     gettext.install('grasslibs', os.path.join(os.getenv("GISBASE"), 'locale'))
>   File "C:\Python27\lib\ntpath.py", line 96, in join
>     assert len(path) > 0
> TypeError: object of type 'NoneType' has no len()

Your dump of os.environ doesn't mention GISBASE.

os.getenv("GISBASE") will return None, and pass it to os.path.join(),
where the "assert len(path) > 0" (line 96 of ntpath.py) will call
len(None), which results in the above TypeError exception.

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


More information about the grass-dev mailing list