Skip to content

Switching to Anaconda2024

Rob Ness edited this page Jul 3, 2024 · 4 revisions

Alter ~/.bashrc to remove old condo init

  • Log into your home ~/ folder on hpcnode1
    cd

  • Make a copy of .bashr rc just in case
    cp ~/.bashrc Original_bashrc

  • Open ~/.bashrc with vi or a ssh text editor
    vi ~/.bashrc

  • Delete this block from bashrc.

# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/opt/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/opt/anaconda3/etc/profile.d/conda.sh" ]; then
. "/opt/anaconda3/etc/profile.d/conda.sh"
else
export PATH="/opt/anaconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<

  • Use vi or a text editor over ssh.
    • Navigate to lines and delete them (press dd in vi to delete each line)
  • Exit and save
    • In vi type :x! To quit and save you can type :q! To quit without save

Log out of hpcnode1 and log back in You should see that you are no longer in conda.


Initialize to new condo

  • You can check what condo version you are using by typing

conda —version

  • If you should condo 2024 - great! Otherwise contact Rob

  • Initialize new condo

conda init

  • Log out of hpcnode1 and log back in (this re reads your bashrc and resets your bash variables)

Fix the notWritable problem

Make a ~/.condarc if you do not have one.

vi ~/.condarc

Add this block if it isn’t already there envs_dirs: - ~/.conda/envs - /opt/anaconda/envs pkgs_dirs: - ~/.conda/pkgs

This will explicitly tell Conda that environments might be global or in HOME but that pkgs will be only in HOME, where everyone has read/write permissions


You should be done. Feel free to use your old envs but I made a new one to avoid possible headaches See Getting started w Conda

  • Chlamy Tips
  • Coding Tips.
  • HpcnodeLife.
  • Other Awesome Pages.

Clone this wiki locally