Welcome, Guest
Username: Password: Remember me

TOPIC: ModuleNotFoundError: No module named '_hermes'

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

  • yugi
  • yugi's Avatar
  • OFFLINE
  • openTELEMAC Guru
  • Posts: 851
  • Thank you received: 244
Good news.
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 11 months ago #37334

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

I want to use python post processing scripts so I am trying to compile v8p2r0 on windows 10 with static api.

I get the same kind of error shared here. I have tried several things mentioned in thsi topic and I cannot fix it...

Am I missing something?

I attached my config and the error.

Many thanks
Juliette
Attachments:
The administrator has disabled public write access.

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

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

Could you try to use the verbose option to obtain more information on the f2py compilation?

Regards
Christophe
The administrator has disabled public write access.

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

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

The error is most likely an issue with the numpy from Anaconda.
Numpy needs to be compiled with the same version of compiler as the sources of telemac. And from what I remember Anaconda uses its own version of gfortran and not the one from the environment.

The verbose should give us the answer.
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 11 months ago #37337

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

Thank you very much for your replies. I added the--verbose into my config but it seems I get the same error. So I re-ran the compilation without the option --quiet (within compil_tools.py).

Could I get it working if I compiled telemac with the gfortran used by Anaconda?

Juliette
Attachments:
The administrator has disabled public write access.

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

  • c.coulet
  • c.coulet's Avatar
  • OFFLINE
  • Moderator
  • Posts: 3722
  • Thank you received: 1031
Yoann is probably better than me to find the origin of your problem with these new information.
By the way, I think it could help if you try to manually run this command
f2py --verbose -c C:\opentelemac\v8p2r0\builds\win10gfors\wrap_api\lib\hermes.pyf --fcompiler=gnu95 --compiler=mingw32 --opt="" -IC:\opentelemac\v8p2r0\builds\win10gfors\wrap_api\include  C:\opentelemac\v8p2r0\builds\win10gfors\lib\libhermes4api.a C:\opentelemac\v8p2r0\builds\win10gfors\lib\libspecial4api.a -lgfortran --build-dir tmp_f2py
which is the one which crash in your case
Christophe
The administrator has disabled public write access.

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

  • yugi
  • yugi's Avatar
  • OFFLINE
  • openTELEMAC Guru
  • Posts: 851
  • Thank you received: 244
Yes it should work if you compile telemac with Anaconda's gfortran.
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 11 months ago #37346

  • chelobarros
  • chelobarros's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 9
  • Thank you received: 1
Hi, I am trying to compile the API for python 3 with compile_telemac.py, with the following relevant systel file extract, following costas example.
options: static api
#
f2py_name: python -m numpy.f2py --build-dir tmp
f2py_opt: -O3
pyd_fcompiler: gnu95
pyd_compiler: mingw32   
#


Then an error ocurrs as follows:
Compiling from the tree top tomawac plus dependents
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        +> There is no need to compile any object
        +> There is no need to package any library
        +> There is no need to create the associate executable

Building the Python API
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    ~> Wrap_api built
Traceback (most recent call last):
  File "compile_telemac.py", line 144, in <module>
    main()
  File "compile_telemac.py", line 137, in main
    hermes_only='hermes_only' in cfg_opt)
  File "C:\opentelemac-mascaret\v8p1\scripts\python3\compilation\compil_tools.py", line 958, in compile_api_files
    ld_flags = get_api_ld_flags(static)
  File "C:\opentelemac-mascaret\v8p1\scripts\python3\compilation\compil_tools.py", line 694, in get_api_ld_flags
    .replace('\n', ' ') + ' ' + ld_flags
KeyError: 'libs_all'

I already changed to yugi`s recomendation on compil_tools.py

Is anyone familiar on how to fix this error for ‘libs_all’?
Gretting,
Chelo.
The administrator has disabled public write access.

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

  • yugi
  • yugi's Avatar
  • OFFLINE
  • openTELEMAC Guru
  • Posts: 851
  • Thank you received: 244
Just add
libs_all:

In you systel.cfg file under general or in you configuration.
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: chelobarros

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

  • chelobarros
  • chelobarros's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 9
  • Thank you received: 1
Thanks Yugi, I have already added libs_all: under general options, but then the execpt.output.decode('utf-8'))) error appear, I have already change line 923 in compil_tools.py but now I have a new error:
Building the Python API
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    ~> Wrap_api built
    ~> Compiling Modules api
    ~> First part of f2py for api passed
Traceback (most recent call last):
  File "C:\opentelemac-mascaret\v8p1\scripts\python3\compilation\compil_tools.py", line 918, in compile_api_f2py
    output = check_output(cmd, shell=True, stderr=STDOUT)
  File "C:\Users\CHELO\anaconda3\lib\subprocess.py", line 411, in check_output
    **kwargs).stdout
  File "C:\Users\CHELO\anaconda3\lib\subprocess.py", line 512, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command 'python -m numpy.f2py --build-dir tmp --quiet -c C:\opentelemac-mascaret\v8p1\builds\win7gfors\wrap_api\lib\api.pyf --fcompiler=gnu95 --compiler=mingw32 --opt="-O3" -IC:\opentelemac-mascaret\v8p1\builds\win7gfors\wrap_api\include   C:\opentelemac-mascaret\v8p1\builds\win7gfors\wrap_api\lib\libapi.lib C:\opentelemac-mascaret\v8p1\builds\win7gfors\wrap_api\lib\libtelemac3d.lib C:\opentelemac-mascaret\v8p1\builds\win7gfors\wrap_api\lib\libtelemac2d.lib C:\opentelemac-mascaret\v8p1\builds\win7gfors\wrap_api\lib\libsisyphe.lib C:\opentelemac-mascaret\v8p1\builds\win7gfors\wrap_api\lib\libgaia.lib C:\opentelemac-mascaret\v8p1\builds\win7gfors\wrap_api\lib\libnestor.lib C:\opentelemac-mascaret\v8p1\builds\win7gfors\wrap_api\lib\libtomawac.lib C:\opentelemac-mascaret\v8p1\builds\win7gfors\wrap_api\lib\libartemis.lib C:\opentelemac-mascaret\v8p1\builds\win7gfors\wrap_api\lib\libkhione.lib C:\opentelemac-mascaret\v8p1\builds\win7gfors\wrap_api\lib\libwaqtel.lib C:\opentelemac-mascaret\v8p1\builds\win7gfors\wrap_api\lib\libgretel.lib C:\opentelemac-mascaret\v8p1\builds\win7gfors\wrap_api\lib\libpartel.lib C:\opentelemac-mascaret\v8p1\builds\win7gfors\wrap_api\lib\libbief.lib C:\opentelemac-mascaret\v8p1\builds\win7gfors\wrap_api\lib\libparallel.lib C:\opentelemac-mascaret\v8p1\builds\win7gfors\wrap_api\lib\libhermes.lib C:\opentelemac-mascaret\v8p1\builds\win7gfors\wrap_api\lib\libdamocles.lib C:\opentelemac-mascaret\v8p1\builds\win7gfors\wrap_api\lib\libspecial.lib  ' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "compile_telemac.py", line 144, in <module>
    main()
  File "compile_telemac.py", line 137, in main
    hermes_only='hermes_only' in cfg_opt)
  File "C:\opentelemac-mascaret\v8p1\scripts\python3\compilation\compil_tools.py", line 972, in compile_api_files
    f2py_opt=f2py_opt)
  File "C:\opentelemac-mascaret\v8p1\scripts\python3\compilation\compil_tools.py", line 923, in compile_api_f2py
    execpt.output.decode('utf-8')))
utils.exceptions.TelemacException: Error during second part of f2py for api 1
analyzevars: charselector={'len': '40'} unhandled.analyzevars: charselector={'len': '200'} unhandled.analyzevars: charselector={'len': '40'} unhandled.analyzevars: charselector={'len': '200'} unhandled.analyzevars: charselector={'len': '40'} unhandled.analyzevars: charselector={'len': '200'} unhandled.analyzevars: charselector={'len': '40'} unhandled.analyzevars: charselector={'len': '200'} unhandled.analyzevars: charselector={'len': '40'} unhandled.analyzevars: charselector={'len': '200'} unhandled.analyzevars: charselector={'len': '32'} unhandled.analyzevars: charselector={'len': '40'} unhandled.analyzevars: charselector={'len': '200'} unhandled.analyzevars: charselector={'len': '40'} unhandled.analyzevars: charselector={'len': '200'} unhandled.analyzevars: charselector={'len': '40'} unhandled.analyzevars: charselector={'len': '200'} unhandled.analyzevars: charselector={'len': '40'} unhandled.analyzevars: charselector={'len': '200'} unhandled.analyzevars: charselector={'len': '40'} unhandled.analyzevars: charselector={'len': '200'} unhandled.getstrlength:intent(hide): expected a string with defined length but got: {'typespec': 'character', 'charselector': {'*': '(*)'}, 'attrspec': [], 'intent': ['out']}
getstrlength:intent(hide): expected a string with defined length but got: {'typespec': 'character', 'charselector': {'*': '(*)'}, 'attrspec': [], 'intent': ['out']}
getstrlength:intent(hide): expected a string with defined length but got: {'typespec': 'character', 'charselector': {'*': '(*)'}, 'attrspec': [], 'intent': ['out']}
error: unknown file type '.lib' (from 'C:\opentelemac-mascaret\v8p1\builds\win7gfors\wrap_api\lib\libapi.lib')


I would appreciate any help on this matter.

Greetings,
Chelo.
The administrator has disabled public write access.
Moderators: borisb

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