Nilearn.masking failure initial test

Testing fmriprep on HPC with a manually installed setup and received the following error;

$ fmriprep /home/bronson/BIDS /home/bronson/out participant
Traceback (most recent call last):
File “/root/anaconda2/bin/fmriprep”, line 11, in
File “/root/anaconda2/lib/python2.7/site-packages/fmriprep/cli/”, line 199, in main
File “/root/anaconda2/lib/python2.7/site-packages/fmriprep/cli/”, line 206, in create_workflow
from …workflows.base import init_fmriprep_wf
File “/root/anaconda2/lib/python2.7/site-packages/fmriprep/workflows/”, line 21, in
from …interfaces import (
File “/root/anaconda2/lib/python2.7/site-packages/fmriprep/interfaces/”, line 8, in
from .images import (
File “/root/anaconda2/lib/python2.7/site-packages/fmriprep/interfaces/”, line 15, in
import nilearn.image as nli
File “/root/anaconda2/lib/python2.7/site-packages/fmriprep/interfaces/”, line 12, in
from nilearn.masking import compute_epi_mask
ImportError: No module named masking

So I attempted to install nilearn;

$ pip install nilearn
Requirement already satisfied: nilearn in /root/anaconda2/lib/python2.7/site-packages
Requirement already satisfied: nibabel>=1.2.0 in /root/anaconda2/lib/python2.7/site-packages (from nilearn)

However the following reveals;

$ which nilearn
/usr/bin/which: no nilearn in (/root/abin/:/root/c3d-1.0.0-Linux x86_64/bin/:/root/antsbin/ants/bin/:/usr/local/fsl/bin:/root/anaconda2/bin:/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin)

Any ideas? I was also able to import nilearn within python2.7 without error

It could be a version mismatch. Have you tried installing upgrading nilearn?

BTW you should check out Singularity - it’s the recommended way to run FMRIPREP on HPCs

Thanks Chris!

pip freeze shows fmriprep 0.6.3 and nilearn 0.3.1

My understanding of Docker has improved somewhat in the past few days, so I might give the Singularity route a go.



One important detail for your bare metal installation is that fmriprep is not Python 2 compatible. It seems you are trying with Python 2.7.


1 Like