Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change python3 version on mac to 3.10.10

I am currently running python 3.9.13 on my mac. I wanted to update my version to 3.10.10

I tried running

brew install python

However it says that "python 3.10.10 is already installed"!

When i run

python3 --version

in the terminal it says that i am still on "python 3.9.13"

So my question is, how do i change the python version from 3.9.13 to 3.10.10? I already deleted python 3.9 from my applications and python 3.10 is the only one that is still there.

I also tried to install python 3.10.10 from the website and installing it. However it does not work. Python 3.10.10 is being installed successfully but the version is still the same when i check it.

like image 850
romanxaver Avatar asked Sep 11 '25 12:09

romanxaver


1 Answers

you can use pyenv or uv to work with multiple python environments

things to do:

  1. install pyenv : brew install pyenvofficial installation guide
  2. install particular python: pyenv install 3.10.10
  3. set python3.10.10 to gloabal python env: pyenv global 3.10.10

and can start using python 3.10.10 version

in my opinion, if you are not good with the terminal or how python is configured in mac system, it is better to leave the original system Python as it is. and use a separate Python manager to help you manage the different Python version independently if something wrong goes then it only affect the environment not the system

update Apart from pyenv there is new package manger called uv which is quite unique fast and great project to handle same things as pyenv but faster

things to do:

  1. install uv : curl -LsSf https://astral.sh/uv/install.sh | sh UV installation guide
  2. install particular python version: uv python install 3.12 3.11 3.13 this will install these 3 python verssion
  3. working with project guide
like image 181
sahasrara62 Avatar answered Sep 13 '25 01:09

sahasrara62