Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: Python API unable to load the dynamic library _hermes.so

Python API unable to load the dynamic library _hermes.so 3 years 10 months ago #37565

  • mark689
  • mark689's Avatar
Hello,

I am still trying to use the python api for telemac2d. I have compiled the file (v8p2r0, ubuntu 18). However, when running the validate_telemac file I'm getting the following error:
utils.exceptions.TelemacException: Error: unable to load the dynamic library _hermes.so
You can check the environment variable: PYTHONPATH
No module named '_hermes'

I have tried the solution in this thread: www.opentelemac.org/index.php/kunena/12-...n-ubuntu-20-04#37285

but it doesn't seem to be working for me.

I have used both python versions 3.8.5 and 3.7 and the problem is still the same.

I would appreciate any input on this. Thanks.


File Attachment:

File Name: systel_2021-01-07.cfg
File Size: 2 KB
The administrator has disabled public write access.

Python API unable to load the dynamic library _hermes.so 3 years 10 months ago #37624

  • yugi
  • yugi's Avatar
  • OFFLINE
  • openTELEMAC Guru
  • Posts: 851
  • Thank you received: 244
Hi,

Can you try launching a python and doing:
import _hermes

And post the message here.
There are 10 types of people in the world: those who understand binary, and those who don't.
The administrator has disabled public write access.

Python API unable to load the dynamic library _hermes.so 3 years 10 months ago #37629

  • mark689
  • mark689's Avatar
Hi, thanks for the reply.

I'm getting the not-found error:
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named '_hermes'
The administrator has disabled public write access.

Python API unable to load the dynamic library _hermes.so 3 years 10 months ago #37634

  • yugi
  • yugi's Avatar
  • OFFLINE
  • openTELEMAC Guru
  • Posts: 851
  • Thank you received: 244
Ok can you post the content of the folder builds/<your config>/wrap_api/lib

Did you get the message that the api was compiled ?

Could you post your environement file as well (PYTHONPATH, LD_LIBRARY_PATH...)
There are 10 types of people in the world: those who understand binary, and those who don't.
The administrator has disabled public write access.

Python API unable to load the dynamic library _hermes.so 3 years 10 months ago #37635

  • mark689
  • mark689's Avatar
Yeah, I did a clean compile and no error message was present (in my previous post).

I can run telemac as well with no problems. Its just when I want to use python the problem occurs.

Here are the 2 files:




File Attachment:

File Name: build_files.txt
File Size: 0 KB


File Attachment:

File Name: env.txt
File Size: 5 KB
The administrator has disabled public write access.

Python API unable to load the dynamic library _hermes.so 3 years 10 months ago #37651

  • yugi
  • yugi's Avatar
  • OFFLINE
  • openTELEMAC Guru
  • Posts: 851
  • Thank you received: 244
Hi,

You are indeed missing some stuff in your environment.
Have a look at configs/pysource.template.sh to see what you are missing.
There are 10 types of people in the world: those who understand binary, and those who don't.
The administrator has disabled public write access.

Python API unable to load the dynamic library _hermes.so 3 years 10 months ago #37657

  • mark689
  • mark689's Avatar
Hello,

I have added the necessary files. Still seems to not be working.

Could you please take a look.

File Attachment:

File Name: env_2021-01-18.txt
File Size: 6 KB
The administrator has disabled public write access.

Python API unable to load the dynamic library _hermes.so 3 years 10 months ago #37666

  • yugi
  • yugi's Avatar
  • OFFLINE
  • openTELEMAC Guru
  • Posts: 851
  • Thank you received: 244
Hi,

You made a mistake in what you added.
I guess you added $HOMETEL/scripts/python3/builds/$USETELCFG/wrap_api/lib

but you did not define HOMETEL and USETELCFG so it did not work.

Like I suggest if you use the pysource.template.sh and change HOMETEL and USETELCFG to match you installation it should work fine.
There are 10 types of people in the world: those who understand binary, and those who don't.
The administrator has disabled public write access.

Python API unable to load the dynamic library _hermes.so 3 years 8 months ago #37973

  • thomas.le
  • thomas.le's Avatar
Hi,
I am very interested in using the postel python scripts but I had exactly the same errors as mark689:
utils.exceptions.TelemacException: Error: unable to load the dynamic library _hermes.so
You can check the environment variable: PYTHONPATH
No module named '_hermes'

and when I try import _hermes:
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named '_hermes'

And I am a little bit lost, indeed I don't have this file "builds/<your config>/wrap_api" in my telemac. I am also using the v8p2r0 and had no errors when compiling. My systel file is attached.

Moreover I don't really understand how the environment file works. I like to work with spyder (python 3.6) and in spyder if I get the environment from os.environ I have a dictionary which does not include the HOMETEL,PYTHONPATH... But if in get my environment directly from the shell I get the environment file attached. Which looks like mark689's one.

I would appreciate any help on my issue. Thanks!

Thomas
Attachments:
The administrator has disabled public write access.

Python API unable to load the dynamic library _hermes.so 3 years 8 months ago #37977

  • yugi
  • yugi's Avatar
  • OFFLINE
  • openTELEMAC Guru
  • Posts: 851
  • Thank you received: 244
Hi,

You should set:
options: api hermes_only

in your systel.cfg file to compile the api.
There are 10 types of people in the world: those who understand binary, and those who don't.
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Moderators: borisb

The open TELEMAC-MASCARET template for Joomla!2.5, the HTML 4 version.