AnacondaOne common reason R packages won't install is an altered environment. This can frequently be caused by the presence Anaconda (or Miniconda) installed locally or initialized in your account from our system module. When Anaconda is initialized, your .bashrc file is edited so that it becomes the first thing in your PATH variable. This can cause all sorts of mayhem. To get around this, you can either remove anaconda from your PATH and deactivate your environment, or comment out/delete the initialization in your ~/.bashrc if you want the change to be permanent. Turn off Auto-activationAnaconda's initialization will tell it to automatically activate itself when you log in (when anaconda is active, you will see a "(conda)" preceding your command prompt). To disable this behavior, run the following from the command line in an interactive terminal session: Code Block |
---|
language | bash |
---|
theme | Midnight |
---|
| conda config --set auto_activate_base false |
This will suppress anaconda's activation until you explicitly call conda activate and is a handy way to have more control over your environment. Once you run this, you will either need to log out and log back in again to make the changes live, or you can follow the instructions in the section below. Sometimes turning off auto-activation won't be enough because Anaconda will still be present in your PATH. Follow the instructions below to completely remove conda from your environment. Temporary RemovalYou can either use the command conda deactivate and then manually edit your PATH variable to remove all instances of anaconda/miniconda or copy the following and run it in your terminal: Code Block |
---|
language | bash |
---|
theme | Midnight |
---|
| conda deactivate > /dev/null 2>&1
IFS=':' read -ra PATHAR <<< "$PATH"
for i in "${PATHAR[@]}"
do if [[ $i == *"conda"* ]]
then echo "removing $i from PATH"
else NEWPATH=$i:$NEWPATH
fi
done
export PATH=$NEWPATH
module unload gnu8 && module load gnu8
unset NEWPATH
echo "Successfully removed conda" |
Permanent Removal Warning |
---|
Your .bashrc file configures your environment each time you start a new session. You may consider making a backup before editing in case of unwanted changes. |
Note: this change will remove anaconda from all future terminal sessions but will not make the changes live right away. To make the changes live, either follow the instructions above under Temporary Removal for removing anaconda from your PATH, or log out and back in again. Code Block |
---|
language | bash |
---|
theme | Midnight |
---|
| $ nano ~/.bashrc # opens your bashrc file to edit |
Then comment out or delete the following lines and the text in between: Code Block |
---|
language | bash |
---|
theme | Midnight |
---|
| # >>> conda initialize >>>
...
# <<< conda initialize <<< |
To exit and save, use control+x and follow the prompts. |