Compatibility issues M2 chip FSL and Nipype

Hi,
for my masterthesis I need to use nipype and FSL. I am working with a mac book pro with a M2 chip. I installed successfully fsl and nipype in a conda environment. Then I applied it on a tutorial example of nipype. But I always get the following error. I wonder if this issue is because of lack of any compatibility. Can somebody help me, i tried already a lot of things too. Has somebody experiences with FSL and Nipype and M2 Mac Book?

Traceback:
Traceback (most recent call last):
File "/Users/theresasolymos/miniconda3/envs/FSLXX/lib/python3.10/site-packages/nipype/pipeline/plugins/linear.py", line 47, in run
node.run(updatehash=updatehash)
File "/Users/theresasolymos/miniconda3/envs/FSLXX/lib/python3.10/site-packages/nipype/pipeline/engine/nodes.py", line 527, in run
result = self._run_interface(execute=True)
File "/Users/theresasolymos/miniconda3/envs/FSLXX/lib/python3.10/site-packages/nipype/pipeline/engine/nodes.py", line 645, in _run_interface
return self._run_command(execute)
File "/Users/theresasolymos/miniconda3/envs/FSLXX/lib/python3.10/site-packages/nipype/pipeline/engine/nodes.py", line 771, in _run_command
raise NodeExecutionError(msg)
nipype.pipeline.engine.nodes.NodeExecutionError: Exception raised while executing Node mcflirt.

Cmdline:
mcflirt -in /Users/theresasolymos/Desktop/NiPypeTrial/preproc01/slicetimer/DIFF.AD.nii.gz_tmp_st.nii -meanvol -out /Users/theresasolymos/Desktop/NiPypeTrial/preproc01/mcflirt/DIFF.AD.nii.gz_tmp_st_mcf.nii -plots
Stdout:

Stderr:

Traceback:
Traceback (most recent call last):
File "/Users/theresasolymos/miniconda3/envs/FSLXX/lib/python3.10/site-packages/nipype/interfaces/base/core.py", line 400, in run
outputs = self.aggregate_outputs(runtime)
File "/Users/theresasolymos/miniconda3/envs/FSLXX/lib/python3.10/site-packages/nipype/interfaces/base/core.py", line 429, in aggregate_outputs
predicted_outputs = self._list_outputs() # Predictions from _list_outputs
File "/Users/theresasolymos/miniconda3/envs/FSLXX/lib/python3.10/site-packages/nipype/interfaces/fsl/preprocess.py", line 936, in _list_outputs
if LooseVersion(Info.version()) < LooseVersion("6.0.0"):
File "/Users/theresasolymos/miniconda3/envs/FSLXX/lib/python3.10/site-packages/looseversion/__init__.py", line 151, in __lt__
c = self._cmp(other)
File "/Users/theresasolymos/miniconda3/envs/FSLXX/lib/python3.10/site-packages/looseversion/__init__.py", line 199, in _cmp
if self.version == other.version:
AttributeError: 'LooseVersion' object has no attribute 'version'

I am gettng this same error. I think it is an issue with Nipype not working with the newer Python versions. I was trying to run it on 3.12.2.

I cannot find out in the documentation with which Python versions NiPype is compatible, but judging from this nipype/docker/generate_dockerfiles.sh at master · nipy/nipype · GitHub it seems that it would work with 3.8

I now tried with python 3.8.19 and it worked.

We had the same error a while ago in Neurodesk.org and for us the problem was that the FSL version wasn’t reported and this command resulted in empty returns:

print(fsl.Info.version())

We fixed this problem in Neurodesk, so if you want you can give it a go there and see how far you get :slight_smile:

Here is an FSL Nipype example in Neurodesk:
https://www.neurodesk.org/example-notebooks/functional_imaging/nipype_fsl_all_levels_flanker.html

Kind regards
Steffen