Nipype fsl interfaces fail in conda env

I created an fsl conda env as described here: Use FSL with conda - FSL - FMRIB Software Library
I’m trying to use a nipype pipeline inside it.
I added and activation script including this:

export FSLDIR="$CONDA_PREFIX"
export FSLOUTPUTTYPE=NIFTI_GZ

If I try python -c “from nipype.interfaces.fsl import Info; print(Info.version())” I get None
It seems to rely on fslversion which output:

FSLDIR:  .../anaconda3/envs/fslmaths-env
Version: Unknown [$FSLDIR/etc/fslversion does not exist]

Should I create a mock fslversion file or is there a better solution?

Hi @mauriliogenovese and welcome to neurostars!

Did you also source $FSLDIR/etc/fslconf/fsl.sh?

Best,
Steven

Yes I did and fls tools work fine by command line, it’s just a nipype issue

Hi @mauriliogenovese,

Is this version file precluding you fro running anything? If so, can you locate an fslversion file in your environment? If you are unable to locate FSL commands, in your Nipype script can you try to add this before calling FSL:

import os
path = “/path/to/fsl/bin” # update for your path
os.environ["PATH"] += os.pathsep + path

Best,
Steven

You’re right, even if Info.version() is None all interfaces can run, I stopped after the first check.
Thank you!