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

Python imp module is now deprecated #2731

Closed
jdtournier opened this issue Oct 22, 2023 · 2 comments
Closed

Python imp module is now deprecated #2731

jdtournier opened this issue Oct 22, 2023 · 2 comments

Comments

@jdtournier
Copy link
Member

jdtournier commented Oct 22, 2023

According to the documentation for the imp module, it is now deprecated:

Deprecated since version 3.4, will be removed in version 3.12: The imp module is deprecated in favor of importlib.

This is used in the mrtrix3.py module to locate and load the main mrtrix3 module. Already causing trouble on the forum. We need to fix this asap...

@Lestropie
Copy link
Member

Looks to me like importlib does not have the requisite functionality in Python 2, which is still supported on master. So need to choose between:

  • Embed logic in bin/mrtrix3.py to use importlib in Python3 and imp in Python2
  • Drop Python2 support on master and tag 3.0.5.

Can change separately on dev since Python2 support has already been dropped there (#2215 pending check in #2534).

@jdtournier
Copy link
Member Author

I reckon we'll need to support both versions for some time. I've had a crack at doing this in #2735, and it's too ugly. I would vastly prefer it if they didn't keep changing things, but there we are...

I'll close this for now, we can discuss on #2735

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

No branches or pull requests

2 participants