Print

Print


Hi Caspar,
  I think the dash might be a red-herring, could your problems be due to limitations in allowed shebang length? If so then the bin/env python3.7 might be conda’s default in this situation, in which case asking users to activate fslpython ( source $FSLDIR/fslpython/bin/activate fslpython ) before using FSL might be a solution, if the long path is fixed.

Hope this helps,
Matthew
--------------------------------
Dr Matthew Webster
FMRIB Centre 
John Radcliffe Hospital
University of Oxford

On 25 Oct 2019, at 14:47, Caspar van Leeuwen <[log in to unmask]> wrote:

Hi Paul,

Thanks for the response. I'm still not getting the correct result though:

[casparl@tcn180 fsl]$ echo $FSLDIR
/home/casparl/.local/easybuild/RedHatEnterpriseServer7/2019/software/FSL/6.0.1-foss-2018b-Python-2.7.15-CUDA-10.0.130/fsl
[casparl@tcn180 fsl]$ rm -rf fslpython/
[casparl@tcn180 fsl]$ PATH=$FSLDIR/fslpython/bin:$PATH $FSLDIR/etc/fslconf/post_install.sh -f $FSLDIR
Stage 1
By installing this python distribution you agree to the license terms in
/home/casparl/.local/easybuild/RedHatEnterpriseServer7/2019/software/FSL/6.0.1-foss-2018b-Python-2.7.15-CUDA-10.0.130/fsl/fslpython/LICENSE.txt
100%
Stage 2
100%
/scratch-local/casparl/fslpythonow8R/fslpython_miniconda_installer.log
Post install setup complete
[casparl@tcn180 fsl]$ which imcp
~/.local/easybuild/RedHatEnterpriseServer7/2019/software/FSL/6.0.1-foss-2018b-Python-2.7.15-CUDA-10.0.130/fsl/bin/imcp
[casparl@tcn180 fsl]$ imcp
/usr/bin/env: python3.7: No such file or directory
[casparl@tcn180 fsl]$ head -n 1 $(which imcp)
#!/usr/bin/env python3.7

In case you're wondering: the reason I need the PATH=$FSLDIR/fslpython/bin:$PATH when running post_install.sh is that otherwise I get

[casparl@tcn180 fsl]$ $FSLDIR/etc/fslconf/post_install.sh -f $FSLDIR
Stage 1
By installing this python distribution you agree to the license terms in
/home/casparl/.local/easybuild/RedHatEnterpriseServer7/2019/software/FSL/6.0.1-foss-2018b-Python-2.7.15-CUDA-10.0.130/fsl/fslpython/LICENSE.txt
100%
Stage 2
100%
Failed to create FSL Python environment - see /scratch-local/casparl/fslpythoncBgj/fslpython_miniconda_installer.log for details
Post install setup failed

[casparl@tcn180 fsl]$ tail -n 5 /scratch-local/casparl/fslpythoncBgj/fslpython_miniconda_installer.log
in Miniconda3: /home/casparl/.local/easybuild/RedHatEnterpriseServer7/2019/software/FSL/6.0.1-foss-2018b-Python-2.7.15-CUDA-10.0.130/fsl/fslpython
Traceback (most recent call last):
 File "/home/casparl/.local/easybuild/RedHatEnterpriseServer7/2019/software/FSL/6.0.1-foss-2018b-Python-2.7.15-CUDA-10.0.130/fsl/fslpython/bin/conda", line 12, in <module>
   from conda.cli import main
ImportError: No module named conda.cli

If I manually put in the correct the full path in the shebang:

[casparl@tcn180 bin]$ head -n 1 imcp
#!/home/casparl/.local/easybuild/RedHatEnterpriseServer7/2019/software/FSL/6.0.1-foss-2018b-Python-2.7.15-CUDA-10.0.130/fsl/fslpython/envs/fslpython/bin/python3.7

I get

-bash: /home/casparl/.local/easybuild/RedHatEnterpriseServer7/2019/software/FSL/6.0.1-foss-2018b-Python-2.7.15-CUDA-10.0.130/fsl/bin/imcp: /home/casparl/.local/easybuild/RedHatEnterpriseServer7/2019/software/FSL/6.0.1: bad interpreter: No such file or directory

Hence my assumption that shebang's don't support hyphens: it seems to be cut off after the 6.0.1, right at the place of the hyphens.

The only way I'm getting imcp to run is if I add

export PATH=$PATH:$FSLDIR/fslpython/envs/fslpython/bin

[casparl@tcn180 ~]$ imcp
Usage:
 imcp <file1> <file2>
 imcp <file1> <directory>
 imcp <file1> <file2> ... <fileN> <directory>

Copy images from <file1> to <file2>, or copy all <file>s to <directory>

NB: filenames can be basenames or include an extension.

Recognised file extensions: .nii.gz, .nii, .img, .hdr, .img.gz, .hdr.gz

This is a bit nasty of course, since it will add all the binaries in that folder, but I really don't have more time to invest in this. So for now, I think I'll take my chances with this workaround...

Anyway, I appreciate all the help, you have been very responsive!

Cheers,

Caspar

########################################################################

To unsubscribe from the FSL list, click the following link:
https://www.jiscmail.ac.uk/cgi-bin/webadmin?SUBED1=FSL&A=1



To unsubscribe from the FSL list, click the following link:
https://www.jiscmail.ac.uk/cgi-bin/webadmin?SUBED1=FSL&A=1