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

Markus Neteler neteler at osgeo.org
Wed May 14 05:06:33 PDT 2014


On Tue, May 13, 2014 at 10:23 PM, Glynn Clements
<glynn at gclements.plus.com> wrote:
>
> 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.

Right, forgot to set it for Windows (in the Linux subsection it was there).
Now it works.

thanks
Markus


More information about the grass-dev mailing list