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

Change in importlib #237

Open
jackaraz opened this issue Jan 18, 2024 · 5 comments
Open

Change in importlib #237

jackaraz opened this issue Jan 18, 2024 · 5 comments
Labels
🐛bug Something isn't working

Comments

@jackaraz
Copy link
Member

System Settings

for python version > 3.9

Describe the bug

Importlib will crash. The find_spec function moved from the util module see this link.

To Reproduce

run ma5

Expected behaviour

No response

Log files

No response

Additional information

No response

@jackaraz jackaraz added the 🐛bug Something isn't working label Jan 18, 2024
@sihyunjeon
Copy link

sihyunjeon commented Feb 4, 2024

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.
it works if lines change like below

from importlib import util

...

# Checking that the 'six' package is present
if not util.find_spec("six"):

@jackaraz
Copy link
Member Author

jackaraz commented Feb 5, 2024

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!

@jackaraz
Copy link
Member Author

jackaraz commented Feb 6, 2024

Dev Note: pkg_resources has a get_distribution function, which can be used to check existing packages. If a package is not found, it raises the pkg_resources.DistributionNotFound error. This is more efficient than importing packages. I believe pkg_resources is universal for all Python versions (needs to be checked)

@sihyunjeon
Copy link

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?

@jackaraz
Copy link
Member Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants