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

Error in 0.5.7: module 'importlib' has no attribute 'util' #379

Open
HelgeEgil opened this issue Apr 19, 2024 · 1 comment
Open

Error in 0.5.7: module 'importlib' has no attribute 'util' #379

HelgeEgil opened this issue Apr 19, 2024 · 1 comment

Comments

@HelgeEgil
Copy link

Thanks for this nice piece of software!
I get the following error when importing dicompylercore 0.5.7 with importlib 1.0.4.

Traceback (most recent call last):
[...]
  File "....\Python39_64\lib\site-packages\dicompylercore\dvhcalc.py", line 15, in <module>
    from dicompylercore.config import skimage_available
  File "C:\....\Python39_64\lib\site-packages\dicompylercore\config.py", line 18, in <module>
    mpl_available = importlib.util.find_spec("matplotlib") is not None
AttributeError: module 'importlib' has no attribute 'util'

If I change line 16 in dicompylercore/config.py from

import importlib

to

import importlib.util

everything loads nicely.

@bastula
Copy link
Member

bastula commented Apr 23, 2024

Hello there, thanks for the kind words!

I see that you are using Python 3.9 on Windows. I haven't run into this particular issue. From what I found it might be able to be fixed by upgrading your matplotlib version. Do you mind to report back your version and see if it is 3.7.5 or below?

Please see here for more reference: https://discuss.python.org/t/python3-11-importlib-no-longer-exposes-util/25641/22

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

2 participants