I have a mac running on Sonoma OS. I know it comes with python automatically, but I need a version 3.8 or less for some projects Im working on for school. However, I have installed 3.8 using homebrew which was installed, but the version of python didnt change. I've tried to update it using pyenv and I haven't been able to update the version. The crazy thing is that even though the version is stated as 3.9.6, if I look for it, I can't find it.
Here is what I did so far:
$ brew update
$ brew install python@3.8
$ python3 --version
Python 3.9.6
$ which python3
/usr/bin/python3
$ which python3.8
/usr/local/bin/python3
$ which python3.9
python3.9 not found
$ brew install pyenv
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(pyenv init -)"' >> ~/.bash_profile
source ~/.bash_profile
Restart your shell so the path changes take effect
exec "$SHELL"
---> this came from an answer to another thread about downgrading python
$ pyenv install 3.8
$ pyenv global 3.8
$ python3 --version
Python 3.9.6
$ which python3
/usr/bin/python3
$ which python3.8
/usr/local/bin/python3
$ which python3.9
python3.9 not found
source https://stackoverflow.com/questions/77848213/sonoma-python-3-8-was-manually-installed-yet-system-shows-3-9-6
Comments
Post a Comment