Welcome, Guest
Username: Password: Remember me

TOPIC: ModuleNotFoundError: No module named '_hermes'

ModuleNotFoundError: No module named '_hermes' 3 years 11 months ago #37357

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

Can rerun the command displayed (pythone -m numpy.f2py...) without the --quiet. (Adding --verbose to compile_telemac.py does the same thing in the latest version).
That sould give you the error message.
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.

ModuleNotFoundError: No module named '_hermes' 3 years 10 months ago #37604

  • jparisi
  • jparisi's Avatar
  • OFFLINE
  • Admin
  • Posts: 114
  • Thank you received: 56
Yugi,

One of my colleague helped and managed to fix the compilation by editing compil_tools.py

Near Line 900:
src_dir = path.join(cfg['root'], 'sources', 'utils', 'hermes')
source_hermes = copy_src_api(api_dir, src_list, src_dir)
#### HRW fix for Windows 10 ######	
# Add an api module to make hermes work 
source_hermes = api_dir + '\\src\\api_handle_var_t3d.f90 ' + source_hermes
return source_api, source_hermes

near Line 1035
     print("    ~> Compiling hermes api")
#    ld_flags = get_api_ld_flags('hermes', static)
#    compile_api_f2py('hermes', api_dir, source_hermes, '',
#                     ld_flags, f2py_name, fcompiler, compiler, silent)
    ld_flags = get_api_ld_flags('api', static)
    compile_api_f2py('hermes', api_dir, source_hermes, skip_source,
                     ld_flags, f2py_name, fcompiler, compiler, silent,
                    f2py_opt=f2py_opt)

We do not fully understand why the few lines edited fixed the problem, so we thought we would share here and ask for some feedback.

Thanks
Juliette
Attachments:
The administrator has disabled public write access.
The following user(s) said Thank You: nitesh

ModuleNotFoundError: No module named '_hermes' 3 years 7 months ago #38230

Hello. We still don't know why the solution that Juliette posted worked, but we have found a simpler solution, which others might find helpful also. There is no need to modify any python, just include this line in the config file:

libs_all: -lgfortran -lquadmath

With this, the hermes module compiles successfully.

Michael Turnbull
The administrator has disabled public write access.
The following user(s) said Thank You: jparisi

ModuleNotFoundError: No module named '_hermes' 3 years 6 months ago #38530

  • nitesh
  • nitesh's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 73
  • Thank you received: 1
Hi,

I am using python 3.9, windows 10 and v8p2r0.
I can compile clean using 'python compile_telemac.py' but when I am trying to use the class 'TelemacFile', I get the same error as the mentioned topic:

TelemacException: Error: unable to load the dynamic library _hermes.dll
You can check the environment variable: PYTHONPATH
No module named '_hermes'

I tried everything posted above but nothing worked for me. Can someone please help me to solve this issue?
Attachments:
The administrator has disabled public write access.

ModuleNotFoundError: No module named '_hermes' 3 years 6 months ago #38532

  • c.coulet
  • c.coulet's Avatar
  • OFFLINE
  • Moderator
  • Posts: 3722
  • Thank you received: 1031
You should compile the API of telemac-mascaret (option: api)
Hope this helps
Christophe
The administrator has disabled public write access.

ModuleNotFoundError: No module named '_hermes' 3 years 6 months ago #38533

Hello.

I also am using Windows 10 and version 8.2.
Here are some lines that we used in our config file that are relevant.

options: api static
f2py_name: f2py
f2py_opt: -O3
pyd_fcompiler: gnu95
pyd_compiler: mingw32

I hope this helps.

Michael
The administrator has disabled public write access.

ModuleNotFoundError: No module named '_hermes' 3 years 6 months ago #38534

  • nitesh
  • nitesh's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 73
  • Thank you received: 1
I tried both the above suggestions.
It says ''f2py' is not recognized as an internal or external command, operable program or batch file.'
Can you please have a look at the errors I got respectively and see if you recognize them?

Thanks!
Attachments:
The administrator has disabled public write access.

ModuleNotFoundError: No module named '_hermes' 3 years 6 months ago #38535

I am using Anaconda python. f2py is one of the scripts available as part of Anaconda python.

Perhaps you can check if you have f2py.exe on your PC somewhere. If so, you could add its location to your PATH.
The administrator has disabled public write access.
The following user(s) said Thank You: nitesh

ModuleNotFoundError: No module named '_hermes' 3 years 6 months ago #38536

  • nitesh
  • nitesh's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 73
  • Thank you received: 1
I defined the path in my computer's environment variables, it did not work. But then I moved f2py.exe to 'C:\opentelemac-mascaret\v8p2\scripts\python3' and it worked.

Thank you so much :)
The administrator has disabled public write access.

ModuleNotFoundError: No module named '_hermes' 3 years 6 months ago #38537

Great! I'm glad it is working now.
The administrator has disabled public write access.
Moderators: borisb

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