fMRIPrep / ModuleNotFoundError: No module named

Hi all,

We are starting to see that the numbers of people encountering the ModuleNotFoundError are on the rise. Typically, this is the error you’d get:

'Traceback (most recent call last):
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/plugins/multiproc.py", line 69, in run_node
    result['result'] = node.run(updatehash=updatehash)
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py", line 410, in run
    cached, updated = self.is_cached()
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py", line 296, in is_cached
    hashed_inputs, hashvalue = self._get_hashval()
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py", line 490, in _get_hashval
    self._get_inputs()
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py", line 517, in _get_inputs
    results = loadpkl(results_file)
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/utils/filemanip.py", line 668, in loadpkl
    raise e
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/utils/filemanip.py", line 659, in loadpkl
    unpkl = pickle.load(pkl_file)
ModuleNotFoundError: No module named 'fmriprep.interfaces.images''

The most likely reason for this is that you are reusing a work directory containing cached results that were obtained with a previous fMRIPrep version.

There are only two solutions to this problem: 1) use the same version you used originally; and 2) wipe out the work directory (or use a new path for it).

This error may occur regardless you are using containers or not.

1 Like

Just to add: unless you were using a veeery old version of fMRIPrep, you should be able to keep your FreeSurfer results.