Python 3 Not Updating in Shell on Mac Mini M1
You can use pyenv
to manage your python3 versions installed on your system.
To install pyenv
:
You can do the following:
# if you dont have homebrew already, install it by:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# install pyenv with homebrew
brew install pyenv
# source pyenv in your .bash_profile if you are using bash
echo 'eval "$(pyenv init -)"' >> ~/.bash_profile
# source pyenv in your .zshrc if you are using zsh
echo 'eval "$(pyenv init -)"' >> ~/.zshrc
Open a new terminal or source your bash_profile or shell profile by: source ~/.bash_profile
or source ~/.zshrc
.
Now to install a new version, you can check the list by:
pyenv install -l | grep anaconda
Find the version you want to install, and install it by:
pyenv install <python-version-to-install>
Now you will be able to see all the different python versions that you have installed by:
pyenv versions
You can choose any of the above output as your global Python from the previous command by:
pyenv global <your-installed-version>
For more details see their git repo at: https://github.com/pyenv/pyenv