-
Notifications
You must be signed in to change notification settings - Fork 18
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
Change in importlib #237
Comments
Hello Jack, I was just going through madanalysis installation and was going to report this but I found that you already took note of the same issue.
|
Hi @sihyunjeon, thanks for the comment! I just need to make sure that it will work in multiple versions of Python at the same time. Probably will need to implement some kind of error handling, will see, thanks! |
Dev Note: |
hi @jackaraz Do you plan to re-release v.1.10.12 or should i wait for v1.10.13 to adapt to this change? |
Hi @sihyunjeon, we will release a new version, but we are all busy atm, so it might take some time along with other planned releases. |
There is already a check of python supported versions at the start of bin/ma5 import importlib
import os
import sys
# Checking if the correct release of Python is installed
if sys.version_info[0] != 3 or sys.version_info[1] <= 6:
sys.exit(
"Python release "
+ sys.version
+ " is detected.\n"
+ "MadAnalysis 5 works only with Python version 3.6 or more recent version.\n"
+ "Please upgrade your Python installation."
) by adding a minor version check the issue can be solved as purposed here if sys.version_info[1] >= 9:
import importlib.util and the code would work as intended. Actually that would work with any supported version because explicitly importing a submodule exposed in the In the end it can look like import importlib.util # Python >= 3.9 compatibility issue (https://github.com/MadAnalysis/madanalysis5/issues/237)
import importlib
import os
import sys
# Checking if the correct release of Python is installed
if sys.version_info[0] != 3 or sys.version_info[1] <= 6:
sys.exit(
"Python release "
+ sys.version
+ " is detected.\n"
+ "MadAnalysis 5 works only with Python version 3.6 or more recent version.\n"
+ "Please upgrade your Python installation."
) I'm happy to makea a PR with the fix. |
Actually I just tested The problem seems to be that some libraries bring So an actual fix would be explicitly import |
Thanks, @davo9819; I'll take a look when I have some time! |
System Settings
for python version > 3.9
Describe the bug
Importlib will crash. The
find_spec
function moved from theutil
module see this link.To Reproduce
run ma5
Expected behaviour
No response
Log files
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: