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.

Hi..
I am getting this sort of error. What to do.. could you help..

Traceback (most recent call last):
File “/home/pc/Downloads/MRtrix3Tissue-master/bin/dwifslpreproc”, line 1124, in
import mrtrix3
File “/home/pc/Downloads/MRtrix3Tissue-master/bin/mrtrix3.py”, line 1, in
import imp, os, sys
ModuleNotFoundError: No module named ‘imp’
Traceback (most recent call last):
File “/home/pc/Downloads/MRtrix3Tissue-master/bin/dwibiascorrect”, line 66, in
import mrtrix3
File “/home/pc/Downloads/MRtrix3Tissue-master/bin/mrtrix3.py”, line 1, in
import imp, os, sys
ModuleNotFoundError: No module named ‘imp’

Hi!
did you find any fix? I am also getting the same error. I am using miniconda on linux.

import imp, os, sys*
ModuleNotFoundError**: No module named ‘imp’

This is a python error. I would suggest downgrading to a previous version.

I hope this helps.

Hi!
I did. but I am getting this error now:

dwifslpreproc: [ERROR] mrconvert se_epi.mif topup_in.nii -import_pe_table se_epi_manual_pe_scheme.txt -strides -1,+2,+3,+4 -export_pe_topup topup_datain.txt (dwifslpreproc:811)

dwifslpreproc: [ERROR] Information from failed command:

dwifslpreproc:
mrconvert: [ERROR] unknown option “-import_pe_table”

Do you know where this might be coming from? how can I solve it? I am using the exact same data as I Andy Brian’s tutorial.