Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation of Gate 10.0.0 - error in opengate/utility.py for Windows 11 and Python >3.11 #651

Open
mbalcerzyk opened this issue Dec 19, 2024 · 4 comments

Comments

@mbalcerzyk
Copy link

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.

@dsarrut
Copy link
Contributor

dsarrut commented Jan 7, 2025

Hi @alexis-pereda, it seems (git blame) that you changed pyd by dll few weeks ago, is there a reason ?

@tbaudier
Copy link
Contributor

tbaudier commented Jan 7, 2025

It's related to this commit
d3ef696

@alexis-pereda
Copy link
Contributor

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?

@bpops
Copy link

bpops commented Feb 20, 2025

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants