
If you want to install a specific version of Python using brew you can use brew install python followed by a @ (at sign) and the version number,
Installing Python 3.8
% brew install python@3.8
Python has been installed as
/opt/homebrew/bin/python3.8
Installing Python 3.9
% brew install python@3.9
Python has been installed as
/opt/homebrew/bin/python3.9
Installing Python 3.10
% brew install python@3.10
Python has been installed as
/opt/homebrew/bin/python3
% brew install python@3.8
Python has been installed as
/opt/homebrew/bin/python3.8% brew install python@3.9
Python has been installed as
/opt/homebrew/bin/python3.9
Installing Python 3.10
% brew install python@3.10
Python has been installed as
/opt/homebrew/bin/python3
% brew install python@3.10
Python has been installed as
/opt/homebrew/bin/python3Make sure to note the path and you can add it to your PATH in .zhrc file to make it permanently accessible.
% ls -F1 /opt/homebrew/bin/python*
/opt/homebrew/bin/python3@
/opt/homebrew/bin/python3-config@
/opt/homebrew/bin/python3.10@
/opt/homebrew/bin/python3.10-config@
/opt/homebrew/bin/python3.8@
/opt/homebrew/bin/python3.8-config@
/opt/homebrew/bin/python3.9@
/opt/homebrew/bin/python3.9-config@
As you can see I have installed all 3 versions of Python using brew.
Provide Feedback For This Article
We take your feedback seriously and use it to improve our content. Thank you for helping us serve you better!
😊 Thanks for your time, your feedback has been registered!
Comments & Discussion
Facing issues? Have questions? Post them here! We're happy to help!