Welcome, Guest
Username: Password: Remember me

TOPIC: ModuleNotFoundError: No module named '_hermes'

ModuleNotFoundError: No module named '_hermes' 4 years 7 months ago #35653

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

THis means that Python could not decode one of the character in f2py listing.
A temporary bypass to get the error message would be to replace:
execpt.output.decode('utf-8')))
by
execpt.output))
In compil_tools at line 926

An rerun we should get 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' 4 years 7 months ago #35664

  • huangziyi2017
  • huangziyi2017's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 19
  • Thank you received: 2
This replacement does enable the error message, which is actually induced by the failure of f2py compilation in the subprocess.
The administrator has disabled public write access.

ModuleNotFoundError: No module named '_hermes' 4 years 7 months ago #35668

  • yugi
  • yugi's Avatar
  • OFFLINE
  • openTELEMAC Guru
  • Posts: 851
  • Thank you received: 244
And could you post 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' 4 years 7 months ago #35663

  • Jose_filho
  • Jose_filho's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 42
  • Thank you received: 2
Hi,
Did you manage to solve this situation?

I came through the same issue...

I've compiled v8p1 with python 3 script "compile_telemac.py', but when I am on the spyder framework to use TelemaFile function, it gives me the same error describd in the topic.

Regards,
The administrator has disabled public write access.

ModuleNotFoundError: No module named '_hermes' 4 years 7 months ago #35665

  • huangziyi2017
  • huangziyi2017's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 19
  • Thank you received: 2
Hi,

Yugi has clarified, you've missed api compilation. So the Class "HermesFile" cannot find the f2py module "_hermes".

The problem has not been solved yet, due to failure of compilation.
The administrator has disabled public write access.

Error compiling api & hermes 4 years 7 months ago #35693

  • cyamin
  • cyamin's Avatar
  • OFFLINE
  • openTELEMAC Guru
  • Posts: 997
  • Thank you received: 234
Hello,
I am also trying to compile the api but I have been unable to do so.
I attach my configuration file and the compilation log with the errors encountered.
I am using the current trunk, Windows 10, MINGW-W64 compilers and WinPython 3.7.1. f2py is installed with the latest numpy.
I would greatly appreciate any help.
Best Regards,
Costas

File Attachment:

File Name: compile_output_trunk_api.txt
File Size: 382 KB

File Attachment:

File Name: systel1.cfg
File Size: 2 KB
The administrator has disabled public write access.

Error compiling api & hermes 4 years 7 months ago #35695

  • c.coulet
  • c.coulet's Avatar
  • OFFLINE
  • Moderator
  • Posts: 3722
  • Thank you received: 1031
Hi Costas

I'm not fully sure I could help you with you own configuration...
Nevertheless I compiled Telemac API on my windows laptop (W10 with gcc 4.8 and python 3.6) but only in manual mode...
After the automatic compilation, I manually run the 2 f2py command line for both api and hermes...
As the command line are directly linked to your configuration, I advise you to proceed as I do. In the script compil_tools.py, remove the --quiet option of f2py line and also print the command line.
On my computer I also noticed I have to place a copy of vcruntime140.dll in the directory wrap_api\lib

As an example of the command line I enclosed the one I have for my computer in V8P1
f2py.py -h c:\opentelemac-mascaret\v8p1\builds\wingforsapi\wrap_api\lib\api.pyf -m _api c:\opentelemac-mascaret\v8p1\builds\wingforsapi\wrap_api\src\api_handle_var_t3d.f90 c:\opentelemac-mascaret\v8p1\builds\wingforsapi\wrap_api\src\api_handle_var_t2d.f90 c:\opentelemac-mascaret\v8p1\builds\wingforsapi\wrap_api\src\api_handle_var_sis.f90 c:\opentelemac-mascaret\v8p1\builds\wingforsapi\wrap_api\src\api_handle_var_art.f90 c:\opentelemac-mascaret\v8p1\builds\wingforsapi\wrap_api\src\api_handle_var_wac.f90 c:\opentelemac-mascaret\v8p1\builds\wingforsapi\wrap_api\src\api_handle_error.f90 c:\opentelemac-mascaret\v8p1\builds\wingforsapi\wrap_api\src\api_interface.f90  skip: get_boolean_t2d_d get_double_t2d_d get_integer_t2d_d get_string_t2d_d get_var_size_t2d_d set_boolean_t2d_d set_double_t2d_d set_integer_t2d_d set_string_t2d_d get_double_array_t2d_d get_integer_array_t2d_d set_double_array_t2d_d set_integer_array_t2d_d get_boolean_sis_d get_double_sis_d get_integer_sis_d get_string_sis_d get_var_size_sis_d set_boolean_sis_d set_double_sis_d set_integer_sis_d set_string_sis_d get_double_array_sis_d get_integer_array_sis_d set_double_array_sis_d set_integer_array_sis_d get_boolean_t3d_d get_double_t3d_d get_integer_t3d_d get_string_t3d_d get_var_size_t3d_d set_boolean_t3d_d set_double_t3d_d set_integer_t3d_d set_string_t3d_d get_double_array_t3d_d get_integer_array_t3d_d set_double_array_t3d_d set_integer_array_t3d_d get_boolean_art_d get_double_art_d get_integer_art_d get_string_art_d get_var_size_art_d set_boolean_art_d set_double_art_d set_integer_art_d set_string_art_d get_double_array_art_d get_integer_array_art_d set_double_array_art_d set_integer_array_art_d get_boolean_wac_d get_double_wac_d get_integer_wac_d get_string_wac_d get_var_size_wac_d set_boolean_wac_d set_double_wac_d set_integer_wac_d set_string_wac_d get_double_array_wac_d get_integer_array_wac_d set_double_array_wac_d set_integer_array_wac_d  :

f2py.py -c api.pyf --compiler=mingw32 --fcompiler=gfortran  --opt="" -Ic:\opentelemac-mascaret\v8p1\builds\wingforsapi\wrap_api\include  -Lc:\opentelemac-mascaret\v8p1\builds\wingforsapi\wrap_api\lib -lapi -ltelemac3d -ltelemac2d -lsisyphe -lgaia -lnestor -ltomawac -lartemis -lkhione -lwaqtel -lgretel -lpartel -lbief -lparallel -lhermes -ldamocles -lspecial

f2py.py -h c:\opentelemac-mascaret\v8p1\builds\wingforsapi\wrap_api\lib\hermes.pyf -m _hermes c:\opentelemac-mascaret\v8p1\builds\wingforsapi\wrap_api\src\close_bnd.f90 c:\opentelemac-mascaret\v8p1\builds\wingforsapi\wrap_api\src\close_mesh.f90 c:\opentelemac-mascaret\v8p1\builds\wingforsapi\wrap_api\src\get_bnd_connectivity.f90 c:\opentelemac-mascaret\v8p1\builds\wingforsapi\wrap_api\src\get_bnd_ipobo.f90 c:\opentelemac-mascaret\v8p1\builds\wingforsapi\wrap_api\src\get_bnd_nelem.f90 c:\opentelemac-mascaret\v8p1\builds\wingforsapi\wrap_api\src\get_bnd_npoin.f90 c:\opentelemac-mascaret\v8p1\builds\wingforsapi\wrap_api\src\get_bnd_numbering.f90 c:\opentelemac-mascaret\v8p1\builds\wingforsapi\wrap_api\src\get_bnd_value.f90 c:\opentelemac-mascaret\v8p1\builds\wingforsapi\wrap_api\src\get_bnd_color.f90 c:\opentelemac-mascaret\v8p1\builds\wingforsapi\wrap_api\src\get_data_ntimestep.f90 c:\opentelemac-mascaret\v8p1\builds\wingforsapi\wrap_api\src\get_data_nvar.f90 c:\opentelemac-mascaret\v8p1\builds\wingforsapi\wrap_api\src\get_data_time.f90 c:\opentelemac-mascaret\v8p1\builds\wingforsapi\wrap_api\src\get_data_value.f90 c:\opentelemac-mascaret\v8p1\builds\wingforsapi\wrap_api\src\get_data_var_list2.f90 c:\opentelemac-mascaret\v8p1\builds\wingforsapi\wrap_api\src\get_mesh_connectivity.f90 c:\opentelemac-mascaret\v8p1\builds\wingforsapi\wrap_api\src\get_mesh_coord.f90 c:\opentelemac-mascaret\v8p1\builds\wingforsapi\wrap_api\src\get_mesh_date.f90 c:\opentelemac-mascaret\v8p1\builds\wingforsapi\wrap_api\src\get_mesh_dimension.f90 c:\opentelemac-mascaret\v8p1\builds\wingforsapi\wrap_api\src\get_mesh_l2g_numbering.f90 c:\opentelemac-mascaret\v8p1\builds\wingforsapi\wrap_api\src\get_mesh_nelem.f90 c:\opentelemac-mascaret\v8p1\builds\wingforsapi\wrap_api\src\get_mesh_nplan.f90 c:\opentelemac-mascaret\v8p1\builds\wingforsapi\wrap_api\src\get_mesh_npoin.f90 c:\opentelemac-mascaret\v8p1\builds\wingforsapi\wrap_api\src\get_mesh_npoin_per_element.f90 c:\opentelemac-mascaret\v8p1\builds\wingforsapi\wrap_api\src\get_mesh_nptir.f90 c:\opentelemac-mascaret\v8p1\builds\wingforsapi\wrap_api\src\get_mesh_title.f90 c:\opentelemac-mascaret\v8p1\builds\wingforsapi\wrap_api\src\open_bnd.f90 c:\opentelemac-mascaret\v8p1\builds\wingforsapi\wrap_api\src\open_mesh.f90 c:\opentelemac-mascaret\v8p1\builds\wingforsapi\wrap_api\src\set_bnd.f90 c:\opentelemac-mascaret\v8p1\builds\wingforsapi\wrap_api\src\set_mesh.f90 c:\opentelemac-mascaret\v8p1\builds\wingforsapi\wrap_api\src\set_header.f90 c:\opentelemac-mascaret\v8p1\builds\wingforsapi\wrap_api\src\add_data.f90 c:\opentelemac-mascaret\v8p1\builds\wingforsapi\wrap_api\src\transfer_group_info.f90 c:\opentelemac-mascaret\v8p1\builds\wingforsapi\wrap_api\src\get_error_message.f90

f2py.py -c hermes.pyf --compiler=mingw32 --fcompiler=gfortran  --opt="" -Ic:\opentelemac-mascaret\v8p1\builds\wingforsapi\wrap_api\include  -Lc:\opentelemac-mascaret\v8p1\builds\wingforsapi\wrap_api\lib -lapi -ltelemac3d -ltelemac2d -lsisyphe -lgaia -lnestor -ltomawac -lartemis -lkhione -lwaqtel -lgretel -lpartel -lbief -lparallel -lhermes -ldamocles -lspecial

Hope this could help you to solve your problem...
Regards
Christophe
The administrator has disabled public write access.
The following user(s) said Thank You: cyamin, huangziyi2017

Error compiling api & hermes 4 years 7 months ago #35696

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

I think this is an issue with the order of the libraries. (This is a pain in the a** with static libraries).
This could be that libs_all should be placed before in the f2py command.

Can you try by modifying that in compilations/compil_tools.py line 727 in get_api_ld_flags:
    ld_flags += cfg['libs_all'] \
        .replace('<root>', cfg['root']) \
        .replace('\n', ' ')
by
    ld_flags = cfg['libs_all'] \
        .replace('<root>', cfg['root']) \
        .replace('\n', ' ') + ' ' + ld_flags

And see how it goes.

By the way for your information on the trunk we added a way to compile in dynamic for Windows/Mac. It seems to work (still needs some feedback) by adding dyn in options.
This means you will need all prerequisites in dynamic.
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.
The following user(s) said Thank You: cyamin, huangziyi2017

Error compiling api & hermes 4 years 7 months ago #35698

  • cyamin
  • cyamin's Avatar
  • OFFLINE
  • openTELEMAC Guru
  • Posts: 997
  • Thank you received: 234
First, will follow Yoann's (easier?) path and if that doesn't pan out, I will try the 'manual' way Christophe suggested.
It seems that the change in compil_tools.py reduced the number of undefined reference errors, or errors in general. You can tell by the size of the log that reduced by 150kb!
Here is the new log:

File Attachment:

File Name: compile_output_trunk_api_2020-04-06-2.txt
File Size: 237 KB


I don't knowh how the pre-requisites are compiled by default. but I will check it out when I get the chance.
The administrator has disabled public write access.

Error compiling api & hermes 4 years 7 months ago #35700

  • c.coulet
  • c.coulet's Avatar
  • OFFLINE
  • Moderator
  • Posts: 3722
  • Thank you received: 1031
Did you take care about the vcruntime140.dll?
I don't remind well but I know this solved some problem for me...

Regards
Christophe
The administrator has disabled public write access.
Moderators: borisb

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