Using the API in a python environment

Hello [name removed],

I am trying to use the Telemac API within the Spyder environment on Windows. I installed Telemac on my laptop using the automatic installer.

The [name removed] scripts worked, after I included “C:\TELEMAC\V8P4\external\python-3.10.9” in my PYTHONPATH.

Then I moved on to the telemac2d_example. I first got the following error when creating the Telemac object:

"TelemacException: Error: unable to load the dynamic library _api.dll

You can check the environment variable: PYTHONPATH

No module named ‘_api’"

I found the dynamic library in “C:\TELEMAC\V8P4\builds\gnu.static\wrap_api\lib”, so I also added this to my PYTHONPATH.

I attached the error, it fails in telemac_dico.py. I also attached my python script.

I am grateful for any guidance, maybe there might something fundamental that I am missing, since I just recently started using python again.

[name removed]

test_telapy_telemac2d_example.txt (319 Bytes)
error_create_telemacobject.txt (941 Bytes)

To clarify:

I get the attached error, after I add the location of the dynamic library to the PYTHONPATH, when creating the Telemac object.

Hello [name removed], perhaps have you solved the problem regarding the use of dynamic simulation within a spyder idle?

[name removed]

I’ve encountered the same problem as you. May I ask if you have solved it?