<div dir="ltr">Hi Laurent,<div>the temporal framework was neither tested nor designed to work in a script that changes the location while running. I would suggest to run the temporal framework related code in a subprocess that is created each time the location or mapset changes. Unfortunately i have no other suggestion. </div><div><br></div><div>However, have you tested your code with grass 7.2 or 7.3? Many improvements have been implement in the recent version that would be beneficial to use.</div><div><br></div><div>Best regards</div><div>Soeren</div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-09-22 2:47 GMT+02:00 Laurent C. <span dir="ltr"><<a href="mailto:lrntct@gmail.com" target="_blank">lrntct@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello all,<br>
<br>
I've ran into another related issue.<br>
One of the goal of running the software outside of GRASS shell is to<br>
batch process simulations in various Locations/mapsets.<br>
<br>
I set the GRASS session for each case. The simulation works well for<br>
the first case.<br>
However when starting the second case, tgis.init() fails with the<br>
following error:<br>
<br>
ERROR: Unable to execute sql statement. There is no temporal database<br>
connection defined for mapset <hull><br>
<br>
The mapset and location are properly set.<br>
If this case is run first, it works well and it's the second one that fail.<br>
Running t.connect -c between two cases does not solve the problem.<br>
Actually, t.connect -p shows the correct connection parameters, but<br>
tgis.init() still fails.<br>
<br>
Regards,<br>
Laurent<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
2016-09-21 18:27 GMT-05:00 Laurent C. <<a href="mailto:lrntct@gmail.com">lrntct@gmail.com</a>>:<br>
> Hi Sören,<br>
><br>
> Setting LD_LIBRARY_PATH is working, thanks. But it cannot be set at<br>
> run-time, which is not very user-friendly.<br>
> I guess this issue is related to the ticket 2424 [1].<br>
><br>
> I managed to get it work at run-time by restarting the program with<br>
> sys.execv() after setting the path [2], but I find it a bit ugly and<br>
> quite verbose to be multi-platform.<br>
><br>
> It would be great if an easier option was possible.<br>
><br>
> Regards,<br>
> Laurent<br>
><br>
> [1] <a href="https://trac.osgeo.org/grass/ticket/2424" rel="noreferrer" target="_blank">https://trac.osgeo.org/grass/<wbr>ticket/2424</a><br>
> [2] <a href="http://stackoverflow.com/questions/6543847/setting-ld-library-path-from-inside-python" rel="noreferrer" target="_blank">http://stackoverflow.com/<wbr>questions/6543847/setting-ld-<wbr>library-path-from-inside-<wbr>python</a><br>
><br>
><br>
> 2016-09-21 15:40 GMT-05:00 Sören Gebbert <<a href="mailto:soerengebbert@googlemail.com">soerengebbert@googlemail.com</a>><wbr>:<br>
>> Hi,<br>
>> i think you have to put the GRASS libraries into your LD_LIBRARY_PATH so<br>
>> that the python wrapper can access them.<br>
>><br>
>> Best regards<br>
>> Soeren<br>
>><br>
>> 2016-09-21 20:37 GMT+02:00 Laurent C. <<a href="mailto:lrntct@gmail.com">lrntct@gmail.com</a>>:<br>
>>><br>
>>> Hello all,<br>
>>><br>
>>> I'm trying to adapt a python module in order for it to be run outside of<br>
>>> GRASS.<br>
>>> I followed the instructions from the wiki and lib/python/script/setup.py<br>
>>><br>
>>> gsetup.init() run without error and I can list maps like in the example.<br>
>>><br>
>>> However, when I try to import the temporal module, I receive this error:<br>
>>><br>
>>> import grass.temporal as tgis<br>
>>>   File "/usr/lib/grass70/etc/python/<wbr>grass/temporal/__init__.py", line<br>
>>> 1, in <module><br>
>>>     from core import *<br>
>>>   File "/usr/lib/grass70/etc/python/<wbr>grass/temporal/core.py", line 38,<br>
>>> in <module><br>
>>>     from c_libraries_interface import *<br>
>>>   File<br>
>>> "/usr/lib/grass70/etc/python/<wbr>grass/temporal/c_libraries_<wbr>interface.py",<br>
>>> line 19, in <module><br>
>>>     import grass.lib.gis as libgis<br>
>>>   File "/usr/lib/grass70/etc/python/<wbr>grass/lib/gis.py", line 23, in<br>
>>> <module><br>
>>>     _libs["grass_gis.7.0.4"] = load_library("grass_gis.7.0.4"<wbr>)<br>
>>>   File "/usr/lib/grass70/etc/python/<wbr>grass/lib/ctypes_loader.py", line<br>
>>> 55, in load_library<br>
>>>     return self.load(path)<br>
>>>   File "/usr/lib/grass70/etc/python/<wbr>grass/lib/ctypes_loader.py", line<br>
>>> 71, in load<br>
>>>     raise ImportError,e<br>
>>> ImportError: <a href="http://libgrass_datetime.7.0.4.so" rel="noreferrer" target="_blank">libgrass_datetime.7.0.4.so</a>: cannot open shared object<br>
>>> file: No such file or directory<br>
>>><br>
>>><br>
>>> Did I forgot to set-up something or this is a bug?<br>
>>><br>
>>> Cheers,<br>
>>> Laurent<br>
>>> ______________________________<wbr>_________________<br>
>>> grass-dev mailing list<br>
>>> <a href="mailto:grass-dev@lists.osgeo.org">grass-dev@lists.osgeo.org</a><br>
>>> <a href="http://lists.osgeo.org/mailman/listinfo/grass-dev" rel="noreferrer" target="_blank">http://lists.osgeo.org/<wbr>mailman/listinfo/grass-dev</a><br>
>><br>
>><br>
</div></div></blockquote></div><br></div>