Dwifslpreproc:mrtrix.py

Sorry, now I have a problem.
When I want to run dwifslpreproc command, I am faced with this error. Can you help me to fix it? :face_with_raised_eyebrow:

My code:dwifslpreproc

Traceback (most recent call last): File “/home/ye/miniconda3/bin/dwifslpreproc”, line 1327, in import mrtrix3 File “/home/ye/miniconda3/bin/mrtrix3.py”, line 17, in import imp, os, sys ModuleNotFoundError: No module named ‘imp’

Hi, Sandy
I meet the same trouble with you, could you tell me whether you dealt with it or not?

This is because 'imp" was removed from Python 3.12 (see Deprecation of Python imp module · Issue #2995 · MRtrix3/mrtrix3 · GitHub).

This problem has been fixed on the master branch, but is not yet part of a tagged release.

The easiest way around this is to use Python 3.11.* instead. Given yo are already using miniconda you can easily create a new conda environment running python 3.11:

conda create --name mrtrix3_env python=3.11
conda activate mrtrix3_env

Alternatively, you could install the latest master version from source, which includes a fix for the problem.

Thanks for your quick response! I create a new conda environment and run python 3.11, but I am sorry to say that it doesn’t work, still the same error.
Is the python version still high? I see an expert as you saying “imp” was improved from Python 3.4 in another post.

Is it a good idea to run python3.3? I am afraid that the low python version will influence the subsequent preprocess.