How to install Python Specific version (3.8, 3.9 or 3.10) using Brew


Installed different versions of Python3 using brew

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

Make 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.



Have Questions? Post them here!
Advertisements
Try Out Code2care Dev Tools:

Advertisements

Advertisements
Code2care is an initiative to publish and share varied knowledge in programming and technical areas gathered during day-to-day learnings and development activities.

Students and software developers can leverage this portal to find solutions to their various queries without re-inventing the wheel by referring to our easy to understand posts. Technical posts might include learnings, tutorials, trouble-shooting steps, video tutorials, code snippets, how-to, blogs, articles, etc.

🎉 We are celebrating the 10th years of Code2care! Thank you for all your support!

We strongly support Gender Equality & Diversity.