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

Support Python 3.12 #7491

Closed
ziw-liu opened this issue Feb 24, 2024 · 1 comment
Closed

Support Python 3.12 #7491

ziw-liu opened this issue Feb 24, 2024 · 1 comment

Comments

@ziw-liu
Copy link

ziw-liu commented Feb 24, 2024

Describe the bug
MONAI does not work with Python 3.12 since it uses the deprecated (and now removed) find_module API from importlib. See Python release note.

To Reproduce

Python 3.12.0 | packaged by conda-forge | (main, Oct  3 2023, 08:36:57) [Clang 15.0.7 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import monai
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/homebrew/Caskroom/miniforge/base/envs/p312/lib/python3.12/site-packages/monai/__init__.py", line 58, in <module>
    load_submodules(sys.modules[__name__], False, exclude_pattern=excludes)
  File "/opt/homebrew/Caskroom/miniforge/base/envs/p312/lib/python3.12/site-packages/monai/utils/module.py", line 212, in load_submodules
    importer.find_module(name).load_module(name)  # type: ignore
    ^^^^^^^^^^^^^^^^^^^^
AttributeError: 'FileFinder' object has no attribute 'find_module'

Expected behavior
This was previously put on hold in #7096 due to torch not supporting 3.12. Since torch now has Python 3.12 support in v2.2.1, MONAI should work as well.

@ziw-liu
Copy link
Author

ziw-liu commented Feb 24, 2024

Already fixed in #7482. Looking forward to a new release!

@ziw-liu ziw-liu closed this as completed Feb 24, 2024
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

1 participant