Installation of Gate 10.0.0 - error in opengate/utility.py for Windows 11 and Python >3.11
When you install Gate 10.0.0 in Windows, after successful installation, there is an error while executing opengate_info and opengate_tests. Tracing back the error, the error is in line 516 of opengate/utility.py. The Python C++ C:\Users\Marcin Balcerzyk\AppData\Local\Programs\Python\Python311\opengate_venv311\Lib\site-packages\opengate_core\opengate_core.cp311-win_amd64 (in your location or 3.12 equivalent) library has *.pyd extension and not *.dll as the script assumes. I have found a solution for that changing to : lib_ext = "pyd" if os.name == "nt" else "so" from lib_ext = "dll" if os.name == "nt" else "so" Then both opengate_info and opengate_test work in Windows 11 with Python 3.11 and 3.12.
Hi @alexis-pereda, it seems (git blame) that you changed pyd by dll few weeks ago, is there a reason ?
It's related to this commit https://github.com/OpenGATE/opengate/commit/d3ef696be9762f239fb9a7a821b1f22b5d84b4f2
The whole get_library_path function is an addition, not a change, and is only called in the print_opengate_info function to give the user the path to the back-end library.
It has to be fixed as I incorrectly assumed that the extension would be dll for Windows, indeed, but I fail to see how it could generate an error, it should only generate an "unknown" location.
I will fix this, but if there is actually an error I should probably fix this error by the way.
@mbalcerzyk could you tell us what is the error you get?
I have the same problem (Windows 11, Python 3.12 here). I tried @mbalcerzyk 's solution, but it still doesn't work for me. The error I receive, @alexis-pereda, is "ImportError: DLL load failed while importing opengate_core: A dynamic link library (DLL) initialization routine failed", occuring on from .opengate_core import * of opengate_core_init_.py (line 23).
Followup: Turns out my issue was not having Visual Studio Redistributable installed. That solved it for me. I did not need to change dll to pyd.
Thank you Done here: https://github.com/OpenGATE/opengate/pull/796