
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!
More Posts related to Python,
- Check version of pip package installer for Python
- How to install Python 3.9 using brew on Mac
- Python Program To Calculate Simple Interest (SimpleInterest.py)
- Indent Python code in Notepad++
- Change label (text) color in tkinter
- Float built-in function in Python
- [Fix] ValueError: substring not found in Python
- pip get list of all outdated Python packages
- Calculate discount amount python code
- 3 Python program to add two numbers
- How to List all Packages installed using pip [Python]
- Python range() function examples
- How to resolve Failed to create interpreter PyCharm Error
- Format Python Code in Visual Studio Code (VS Code)
- Validate email address in Python using regular expression (regex)
- Install and Run Jupyter Notebook on Mac (macOS)
- How to delete a file using Python code example
- Base64 Encoding Decoding in Python Programming
- How to pip install Python Modules in VSCode
- Change the background of Tkinter label or text
- Comments in Python Programming
- Take input argument from command line in Python Programming
- How to Convert Python String to DateTime Object
- Tkinter - add x and y padding to label text
- [Tutorial] Install Python on Visual Studio Code (VS Code)
More Posts:
- cURL Option to show HTTP Response Status Code - cURL
- Fix: Amazon Linux bash: sudo: command not found - AWS
- How to Set Homepage on Chrome - Chrome
- Disable EditText Cursor Android - Android
- [Nopepad++] How to add text at end of each line - NotepadPlusPlus
- [fix] Docker: OCI runtime exec failed unable to start container process - Docker
- Java location in Mac OS X - Mac-OS-X
- Deep Dive: Why avoid java.util.Date and Calendar Classes - Java