Skip to content

Instantly share code, notes, and snippets.

@nygeog
Created December 10, 2019 01:33
Show Gist options
  • Save nygeog/c9f9662718d5ac857808301f933de584 to your computer and use it in GitHub Desktop.
Save nygeog/c9f9662718d5ac857808301f933de584 to your computer and use it in GitHub Desktop.
Bash Profile Question on how to make Alias for Anaconda
# added by Anaconda3 2019.10 installer
# >>> conda init >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$(CONDA_REPORT_ERRORS=false '/Users/{...username...}/opt/anaconda3/bin/conda' shell.bash hook 2> /dev/null)"
if [ $? -eq 0 ]; then
\eval "$__conda_setup"
else
if [ -f "/Users/{...username...}/opt/anaconda3/etc/profile.d/conda.sh" ]; then
. "/Users/{...username...}/opt/anaconda3/etc/profile.d/conda.sh"
CONDA_CHANGEPS1=false conda activate base
else
\export PATH="/Users/{...username...}/opt/anaconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda init <<<
@nygeog
Copy link
Author

nygeog commented Dec 10, 2019

From this, https://stackoverflow.com/questions/24664435/use-default-python-rather-than-anaconda-installation-when-called-from-the-termin has an example of not setting Python path, but setting as an Alias, ie.

alias pyconda='~/anaconda3/bin/python3'

I'm just not sure how to substitute it where export PATH=... while also including the stuff at conda activate base

So what I'd like to have though is something where I can do $ pyconda and it activates conda and then activates base environment or another environment (such as dsi).

Other resources:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment