0

I think I may have messed up my bash profile and I am unable to access anaconda from my Mac terminal

Below is my bash profile and I am wondering if I can get some help with it. I think I may have twitched some code. I started facing this issue with this after I switched to Mac OS Ventura

FSL_DIR=/usr/local/fsl
PATH=${FSL_DIR}/share/fsl/bin:${PATH}
export FSL_DIR PATH
. ${FSL_DIR}/etc/fslconf/fsl.sh


export MallocNanoZone=0 && freeview

export FS_LICENSE=$HOME/license.txt
export FREESURFER_HOME=/Applications/freesurfer/7.3.2
source $FREESURFER_HOME/SetUpFreeSurfer.sh

export PATH=/Applications/MATLAB_R2020b.app/bin:$PATH


# auto-inserted by @update.afni.binaries :
export PATH=$PATH:/Users/reubenaddison/abin
export DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}:/opt/X11/lib/flat_namespace

# auto-inserted by @update.afni.binaries :
#    set up tab completion for AFNI programs
if [ -f $HOME/.afni/help/all_progs.COMP.bash ]
then
source $HOME/.afni/help/all_progs.COMP.bash
fi


## Added by SimNIBS
SIMNIBS_BIN="/Users/reubenaddison/Applications/SimNIBS-4.0/bin"
export PATH=${PATH}:${SIMNIBS_BIN}export PATH=$PATH:/Desktop/workbench/bin_macosx64
export PATH=$PATH:/Applications/workbench/bin_macosx64
export PATH=$PATH:/Applications/workbench/bin_macosx64


# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/usr/local/fsl/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
    eval "$__conda_setup"
else
    if [ -f "/usr/local/fsl/etc/profile.d/conda.sh" ]; then
        . "/usr/local/fsl/etc/profile.d/conda.sh"
    else
        export PATH="/usr/local/fsl/bin:$PATH"
    fi
fi
unset __conda_setup
# <<< conda initialize <<<
Charles Duffy
  • 280,126
  • 43
  • 390
  • 441
  • It's obligatory to have a _narrow, specific_ question with the shortest possible code that reproduces a problem isolated before asking here. You haven't worked out which code is/isn't relevant to the problem, so this isn't a [mre]. – Charles Duffy Apr 11 '23 at 16:28
  • 1
    One thing you might do to help understand the problem a bit better (and thus ask a better question) is to run `PS4=':$BASH_SOURCE:$LINENO+' bash -xli` and trace through the logs that generates. Does the `shell.bash hook` command succeed at generating `eval`-able code? What happens when that code is actually eval'd? Etc. – Charles Duffy Apr 11 '23 at 16:29
  • 1
    Is the ananconda executable in the path? Run `which conda` – ventsyv Apr 11 '23 at 16:32
  • Sorry for silly question, but: Are you still using `bash`? Default is `zsh`. – merv Apr 11 '23 at 18:13

1 Answers1

1

My first thought is that is a LOT of path manipulation. Rather than adding so much to PATH, consider copying some of these scripts/apps to some location already in the PATH.

Second, Looks like you need a line break in this line:

export PATH=${PATH}:${SIMNIBS_BIN}export PATH=$PATH:/Desktop/workbench/bin_macosx64

Third, you've got this appended twice. Get rid of one of these.

export PATH=$PATH:/Applications/workbench/bin_macosx64
export PATH=$PATH:/Applications/workbench/bin_macosx64
S. Imp
  • 2,833
  • 11
  • 24