MRtrix3 / mrtrix3

MRtrix3 provides a set of tools to perform various advanced diffusion MRI analyses, including constrained spherical deconvolution (CSD), probabilistic tractography, track-density imaging, and apparent fibre density
http://www.mrtrix.org
Mozilla Public License 2.0
294 stars 181 forks source link

Deprecation of Python imp module #2995

Closed vinferrer closed 2 months ago

vinferrer commented 2 months ago

Describe the bug

When using dwicat, there is an import error for the module imp, I believe this is due to the fact that imp is deprecated and you should change it for the importlib: https://docs.python.org/3.11/library/imp.html

To Reproduce

conda create -n mrtrix-3.0.4 -c mrtrix3 mrtrix3=3.0.4
 conda activate mrtrix-3.0.4
dwicat 
Traceback (most recent call last):
  File "/home/vicente/miniconda3/envs/mrtrix-3.0.4/bin/dwicat", line 161, in <module>
    import mrtrix3
  File "/home/vicente/miniconda3/envs/mrtrix-3.0.4/bin/mrtrix3.py", line 17, in <module>
    import imp, os, sys
ModuleNotFoundError: No module named 'imp'

If the issue is data-dependent, please consider providing a link to (anonymised) data to assist developers in reproducing the bug.

Platform/Environment/Version

Please provide the following information:

Lestropie commented 2 months ago

Thanks for the bump. This is already rectified on master (#2731, #2735), but is not yet part of a tagged release. If you configure your environment to use Python 3.11 rather than 3.12 you should be able to get by until we do an update.

@MRtrix3/mrtrix3-devs: We should prioritise generating 3.0.5, as otherwise this will keep coming up. I have created a milestone for this patch update. Many PRs to master require independent review; please pick some to look at and approve.