简体   繁体   中英

How to change Python Version in Terminal? (MacOS)

when I type type python3 it shows python3 is /opt/anaconda3/bin/python3

I'm trying to change it so that it shows python3 is /usr/local/bin/python3

This is currently what pulls up when I type nano.bash_profile in the terminal:


PATH="/Library/Frameworks/Python.framework/Versions/3.9/bin:${PATH}"
Export PATH


>>> 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

I have two other anaconda python interpreters that I don't wish to use. Please help.

Try typing this to prevent conda auto initialize base environment when open terminal

conda config --set auto_activate_base false

And change false to true to activate auto initialize conda environment

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM