I have all three versions of python 3.10, 3.11 and 3.12 using homebrew. but somehow homebrew defaults to using 3.11 as the default.
when i type which python3
, it shows 3.11.6 as the version instead of 3.12. why did it default to 3.11 and how do i change this to 3.12?
I was expecting the latest version 3.12 to be the default.
It seems to me that Homebrew defaults to Python 3.11.6 due to the current configuration of your system PATH or the way Homebrew has linked the Python versions. To change the default version to Python 3.12, you might want to try the following steps:
brew info [email protected]
~/.zshrc
or ~/.bash_profile
) to put the directory containing Python 3.12 executable before others:export PATH="/usr/local/opt/[email protected]/bin:$PATH"
link
command to change the default Python version. Be cautious as this could lead to broken dependencies:brew link --overwrite [email protected]
pyenv
: brew install pyenv
pyenv install 3.12.0
pyenv global 3.12.0