Difficulty with fsl and nipype following fmriprep preprocessing

Hi all, I’m trying to complete a first level analysis with nipype and fsl and am running into difficulties. I’ve based my script on the one here: fmri-analysis-vm/First and Second Level Modeling (FSL).ipynb at master · poldrack/fmri-analysis-vm · GitHub
I’m using WSL to run FSL via ubuntu. When I run my script I get the following error:
OSError: No command “fslroi” found on host DESKTOP-0FOCVUK. Please check that the corresponding package is installed.
I’m guessing, that the issue is because the spyder terminal is not able to find the fsl file directory but if this is the case, I’m not sure how to fix this. Is there a way of specifying the location of fsl (usr/local/fsl)?
I’m very new to interfacing WSL, Ubuntu etc so any help would be greatly appreciated. Thanks.

It would help if you could provide the command that prompts this error. From the error you mentioned I would guess that it’s skip = mem.cache(fsl.ExtractROI)? I presume you are running a python script similar to the one you linked. Are you using fslpy or the FSL Nipype interface? Have you installed these packages to whatever environment you are running Python in?


Hi, thanks for taking the time to reply, I’m using the fsl nipype interface. Yeah, sorry, that’s the command that is causing the error. I think that is the issue. I’m on windows 10 and I followed the fsl install guide . It’s installed via ubuntu but this means it is not in the same environment as python where I am running my script. Would that mean I have to install python and all relevant modules such as nipype on ubuntu so that the script is able to find fsl? or is there a way of setting a path? Like I say, its all very unfamiliar to me so any guidance appreciated,
Thanks again, Henry

Hi Henry,

I’m a little confused by:

Aren’t both of these separate operating systems? Do you mean to say that from your personal computer (Windows), you SSH’d into a computer/cluster that uses ubuntu and am running the command from there? You would have to install FSL on the same environment where python is being run, which sounds like it’s ubuntu.


Sorry for the confusion but you basically guessed it right. Python was being run on my windows 10 pc and fsl was running on WSL via the ubuntu shell. I installed python and nipype onto the windows subsytem for linux and it seems to have fixed the error. Thanks again,