Fmriprep bids_dir not recognized

Hi all,
I am new to fmriprep and fmri. I am trying to run version 20.0.3 in a bare-metal installation. I was able to run it to completion several months ago during testing, but now fmriprep is exiting without running.
My command is as follows:

fmriprep BIDS/NIFTI/ BIDS/derivatives/ participant --participant-label A001 --notrack

And I get the following error:

Traceback (most recent call last):
File “/gs/gsfs0/users/yifeman/.local/bin/fmriprep”, line 11, in
sys.exit(main())
File “/gs/gsfs0/users/yifeman/.local/lib/python3.6/site-packages/fmriprep/cli/run.py”, line 355, in main
bids_dir = Path(retval.get(‘bids_dir’))
File “/public/apps/anaconda/3-5.2.0/lib/python3.6/pathlib.py”, line 999, in new
self = cls._from_parts(args, init=False)
File “/public/apps/anaconda/3-5.2.0/lib/python3.6/pathlib.py”, line 656, in _from_parts
drv, root, parts = self._parse_args(args)
File “/public/apps/anaconda/3-5.2.0/lib/python3.6/pathlib.py”, line 640, in _parse_args
a = os.fspath(a)
TypeError: expected str, bytes or os.PathLike object, not NoneType

Is this is an issue with one of the external dependencies having the correct path? I’m running freesurfer 6.0 and the license.txt file is in $FREESURFER_HOME so I don’t think that is the issue. Any other suggestions would be greatly appreciated.
Thanks.

I think you are hitting an issue we addressed in some initial release of the 20.0.x series regarding, as you mention the FS license.

Could you upgrade to the latest 20.0.x release (which is 20.0.7) or a more recent (20.1.3 or even better, 20.2.0 LTS, if you can wait until Monday)?

Thanks, that worked. Just running into a different issue now. I upgraded to version 20.1.3 of fmriprep and freesurfer 6.0.0. I get the following standar error:

Traceback (most recent call last):
File “/gs/gsfs0/users/yifeman/.conda/envs/my-conda-env/lib/python3.7/site-packages/nipype/pipeline/plugins/multiproc.py”, line 67, in run_node
result[“result”] = node.run(updatehash=updatehash)
File “/gs/gsfs0/users/yifeman/.conda/envs/my-conda-env/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py”, line 516, in run
result = self._run_interface(execute=True)
File “/gs/gsfs0/users/yifeman/.conda/envs/my-conda-env/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py”, line 635, in _run_interface
return self._run_command(execute)
File “/gs/gsfs0/users/yifeman/.conda/envs/my-conda-env/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py”, line 741, in _run_command
result = self._interface.run(cwd=outdir)
File “/gs/gsfs0/users/yifeman/.conda/envs/my-conda-env/lib/python3.7/site-packages/nipype/interfaces/base/core.py”, line 397, in run
runtime = self._run_interface(runtime)
File “/gs/gsfs0/users/yifeman/.conda/envs/my-conda-env/lib/python3.7/site-packages/nipype/interfaces/base/core.py”, line 792, in _run_interface
self.raise_exception(runtime)
File “/gs/gsfs0/users/yifeman/.conda/envs/my-conda-env/lib/python3.7/site-packages/nipype/interfaces/base/core.py”, line 723, in raise_exception
).format(**runtime.dictcopy())
RuntimeError: Command:
recon-all -autorecon1 -noskullstrip -hires -openmp 7 -subjid sub-A006 -sd /home/users/yifeman/BIDS_walkthrough/freesurfer -xopts-use -nomotioncor
Standard output:
INFO: hi-res volumes are conformed to the min voxel size
Subject Stamp: freesurfer-Linux-centos6_x86_64-stable-pub-v6.0.0-2beb96c
Current Stamp: freesurfer-Linux-centos6_x86_64-stable-pub-v6.0.0-2beb96c
INFO: SUBJECTS_DIR is /gs/gsfs0/users/yifeman/BIDS_walkthrough/freesurfer
Actual FREESURFER_HOME /gs/gsfs0/hpc01/apps/freesurfer/6.0.0
-rwx------ 1 yifeman res_com_domain_users 22553 Sep 24 10:59 /gs/gsfs0/users/yifeman/BIDS_walkthrough/freesurfer/sub-A006/scripts/recon-all.log
Linux loginnode2 2.6.32-696.6.3.el6.694g0000.x86_64 #1 SMP Wed Jul 12 02:19:57 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
/gs/gsfs0/hpc01/apps/freesurfer/6.0.0/bin/recon-all' -> /gs/gsfs0/users/yifeman/BIDS_walkthrough/freesurfer/sub-A006/scripts/recon-all.local-copy’
#--------------------------------------------
#@# Talairach Thu Sep 24 12:28:47 EDT 2020
/gs/gsfs0/users/yifeman/BIDS_walkthrough/freesurfer/sub-A006/mri

mri_nu_correct.mni --no-rescale --i orig.mgz --o orig_nu.mgz --n 1 --proto-iters 1000 --distance 50

/gs/gsfs0/users/yifeman/BIDS_walkthrough/freesurfer/sub-A006/mri
/public/apps/freesurfer/6.0.0/bin/mri_nu_correct.mni
–no-rescale --i orig.mgz --o orig_nu.mgz --n 1 --proto-iters 1000 --distance 50
nIters 1
Id: mri_nu_correct.mni,v 1.27 2016/02/26 16:19:49 mreuter Exp
Linux loginnode2 2.6.32-696.6.3.el6.694g0000.x86_64 #1 SMP Wed Jul 12 02:19:57 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
Thu Sep 24 12:28:47 EDT 2020
Can’t locate MNI/Startup.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /public/apps/freesurfer/6.0.0/mni/bin/nu_correct line 37.
BEGIN failed–compilation aborted at /public/apps/freesurfer/6.0.0/mni/bin/nu_correct line 37.
/usr/bin/bc
tmpdir is ./tmp.mri_nu_correct.mni.22941
/gs/gsfs0/users/yifeman/BIDS_walkthrough/freesurfer/sub-A006/mri
mri_convert orig.mgz ./tmp.mri_nu_correct.mni.22941/nu0.mnc -odt float
mri_convert.bin orig.mgz ./tmp.mri_nu_correct.mni.22941/nu0.mnc -odt float
Id: mri_convert.c,v 1.226 2016/02/26 16:15:24 mreuter Exp
reading from orig.mgz…
TR=9.86, TE=0.00, TI=0.00, flip angle=0.00
i_ras = (-1, 4.47035e-09, -4.47035e-09)
j_ras = (-4.47035e-09, -8.9407e-09, -1)
k_ras = (1.11759e-09, 1, -8.9407e-09)
changing data type from uchar to float (noscale = 0)…
writing to ./tmp.mri_nu_correct.mni.22941/nu0.mnc…
Outputting Volume: …


Iteration 1 Thu Sep 24 12:29:05 EDT 2020
nu_correct -clobber ./tmp.mri_nu_correct.mni.22941/nu0.mnc ./tmp.mri_nu_correct.mni.22941/nu1.mnc -tmpdir ./tmp.mri_nu_correct.mni.22941/0/ -iterations 1000 -distance 50
Can’t locate MNI/Startup.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /public/apps/freesurfer/6.0.0/mni/bin/nu_correct line 37.
BEGIN failed–compilation aborted at /public/apps/freesurfer/6.0.0/mni/bin/nu_correct line 37.
ERROR: nu_correct
Linux loginnode2 2.6.32-696.6.3.el6.694g0000.x86_64 #1 SMP Wed Jul 12 02:19:57 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

recon-all -s sub-A006 exited with ERRORS at Thu Sep 24 12:29:05 EDT 2020

For more details, see the log file /gs/gsfs0/users/yifeman/BIDS_walkthrough/freesurfer/sub-A006/scripts/recon-all.log
To report a problem, see http://surfer.nmr.mgh.harvard.edu/fswiki/BugReporting

Standard error:
Can’t locate MNI/Startup.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /public/apps/freesurfer/6.0.0/mni/bin/nu_correct line 37.
BEGIN failed–compilation aborted at /public/apps/freesurfer/6.0.0/mni/bin/nu_correct line 37.
Return code: 1

I found my MNI/Startup.pm script in “/public/apps/freesurfer/6.0.0/mni/lib/perl5/5.8.5/MNI/Startup.pm” so I’m not sure why freesurfer is not finding this as well. This path is saved with the variable $MNI_PERL5LIB. Thanks for your help!

This looks to me like an installation problem of FreeSurfer. I’d suggest moving on to singularity to avoid these.

BTW, since the issue now is different, please open a new thread.