IMHO, the best way to use two different Python versions on macOS is via homebrew. After installing homebrew on macOS, run the commands below on your terminal.

brew install python@2
brew install python

Now you can run Python 2.7 by invoking python2 or Python 3 by invoking python3. In addition to this, you can use virtualenv or pyenv to manage different versions of python environments.

I have never personally used miniconda but from the documentation, it looks like it is similar to using pip and virtualenv in combination.

Answer from forevergenin on Stack Overflow
🌐
Medium
nikhilavula.medium.com › multiple-python-on-macos-740b3dead43d
Multiple python on MacOS. When work on different project using… | by Nikhil Avula | Medium
January 21, 2023 - For example, If I want to install python version 3.10.0, I run pyenv install 3.10.0 · Switching between versions is very simple process, we will be using pyenv shell command to switch between the versions.
Discussions

Switch to a specific version of Python on macOS
Output of brew config HOMEBREW_VERSION: 4.1.17 ORIGIN: https://github.com/Homebrew/brew HEAD: 35746e0a6ba6c3c5cfe56d99f79d9ec9f52ee15f Last commit: 33 hours ago Core tap JSON: 23 Oct 15:41 UTC HOME... More on github.com
🌐 github.com
2
4
Recommended way to manage several installed versions of Python (macOS)
Use uv and create venv for every project. More on reddit.com
🌐 r/Python
117
75
April 4, 2025
I installed python 3.10 on my Mac but when I enter “python —version” it returns 3.8.3. How do I fix this?
A better option is probably to leave your system version alone and use pyenv. More on reddit.com
🌐 r/learnpython
86
148
June 26, 2022
How can I switch default python version on command line?
I use "pyenv" for this. It is a package you install that lets you download different python versions and easily switch between them. More on reddit.com
🌐 r/learnpython
2
3
July 22, 2024
Top answer
1 of 12
71

The simplest way would be to add an alias to python3 to always point to the native python installed. Add this line to the .bash_profile file in your $HOME directory at the last,

alias python="python3"

Doing so makes the changes to be reflected on every interactive shell opened.

2 of 12
27

pyenv is a 3rd party version manager which is super commonly used (18k stars, 1.6k forks) and exactly what I looked for when I came to this question.

edit: I use it for several years now. Works like a charm.

Installation

Install pyenv.

Usage

$ pyenv install --list
Available versions:
  2.1.3
  [...]
  3.8.1
  3.9-dev
  activepython-2.7.14
  activepython-3.5.4
  activepython-3.6.0
  anaconda-1.4.0
  [... a lot more; including anaconda, miniconda, activepython, ironpython, pypy, stackless, ....]

$ pyenv install 3.8.1
Downloading Python-3.8.1.tar.xz...
-> https://www.python.org/ftp/python/3.8.1/Python-3.8.1.tar.xz
Installing Python-3.8.1...
Installed Python-3.8.1 to /home/moose/.pyenv/versions/3.8.1

$ pyenv versions
* system (set by /home/moose/.pyenv/version)
  2.7.16
  3.5.7
  3.6.9
  3.7.4
  3.8-dev

$ python --version
Python 2.7.17
$ pip --version
pip 19.3.1 from /home/moose/.local/lib/python3.6/site-packages/pip (python 3.6)

# Writing the .python-version file does the switch:
$ mkdir pyenv-experiment && echo "3.8.1" > "pyenv-experiment/.python-version"
# alternatively, you could use `pyenv local 3.8.1`
$ cd pyenv-experiment

$ python --version
Python 3.8.1
$ pip --version
pip 19.2.3 from /home/moose/.pyenv/versions/3.8.1/lib/python3.8/site-packages/pip (python 3.8)
🌐
Reddit
reddit.com › r/python › recommended way to manage several installed versions of python (macos)
r/Python on Reddit: Recommended way to manage several installed versions of Python (macOS)
April 4, 2025 -

When I use VS Code and select a version of Python on macOS, I have the following versions:

  • Python 3.12.8 ('3.12.8') ~/.pyenv/versions/3.12.8/bin/python

  • Python 3.13.2 /opt/homebrew/bin/python

  • Python 3.12.8 /usr/local/bin/python3

  • Python 3.9.6 /Library/Developer/CommandLineTools/usr/bin/python3

  • Python 3.9.6 /usr/bin/python3

I believe having this many versions of Python in different locations messes me up when trying to install packages (i.e. using brew vs pip3 vs pyenv), so I'm wondering what the best way is to clean this up and make package + version management easier?

🌐
Plain English
python.plainenglish.io › how-to-manage-different-python-versions-on-mac-os-11-big-sur-b285d98fdaf1
How to manage different Python Versions on Mac OS 11 Big Sur
March 19, 2021 - This article is about an easy way to switch between Python versions using Pyenv on Mac OS Big Sur and make Pyenv perfectly working with Homebrew
🌐
weKnow Inc.
weknowinc.com › home › technical articles › running multiple python versions in mac osx
Running Multiple Python Versions in Mac OSX | weKnow Inc. | IT Staffing and Development Agency in Latin America
November 20, 2025 - To be able to switch quickly between different versions of Python, we will use Pyenv. Installing Pyenv on Mac OS X is very simple with Homebrew:
Find elsewhere
🌐
GitHub
github.com › pyenv › pyenv
GitHub - pyenv/pyenv: Simple Python version management · GitHub
Homebrew in macOS · Windows · Set up your shell environment for Pyenv · Restart your shell · Install Python build dependencies · Upgrade Notes · Usage · Install additional Python versions · Prefix auto-resolution to the latest version · Python versions with extended support · Switch between Python versions ·
Starred by 44.6K users
Forked by 3.2K users
Languages   Shell 86.9% | Python 10.8% | Makefile 1.5% | C 0.4% | Roff 0.2% | Dockerfile 0.2%
🌐
Real Python
realpython.com › intro-to-pyenv
Managing Multiple Python Versions With pyenv – Real Python
September 1, 2025 - Get Your Cheat Sheet: Click here to download a free cheat sheet that shows you how to use pyenv to manage multiple versions of Python. Now that you have some experience with pyenv in Python, you can use the questions and answers below to check your understanding and recap what you’ve learned. These FAQs are related to the most important concepts you’ve covered in this tutorial. Click the Show/Hide toggle beside each question to reveal the answer. ... You use pyenv to install, manage, and switch between multiple Python versions without interfering with your operating system’s default Python installation.
🌐
CodeRivers
coderivers.org › blog › how-to-switch-python-version-mac
How to Switch Python Versions on Mac - CodeRivers
January 23, 2025 - If you want to use the system-installed Python (Python 2.7 in older macOS versions), simply run the python command in the terminal. To switch to Python 3 (if installed system-wide), use the python3 command.
🌐
Medium
medium.com › @shaikhquader › how-to-change-the-default-python3-in-macos-monterey-bacea944695e
How to Change the Default Python3 in macOS | by Shaikh Quader | Medium
August 10, 2022 - How to Change the Default Python3 in macOS If your MacBook has multiple installations of Python 3.x, you might run into a sticky situation I was in earlier today. My macOS (Monterey) has three Python …
🌐
Faun
faun.pub › how-to-install-multiple-python-on-your-mac-d20713740a2d
How to install multiple Python on your Mac | by Robioki Denis | FAUN.dev() 🐾
October 2, 2024 - To install Homebrew, open your ... prompts to complete the installation. pyenv is a Python version manager that lets you easily install and switch between multiple Python versions....
Top answer
1 of 8
114

pyenv is the thing you want. It works very very well:

pyenv lets you easily switch between multiple versions of Python. It's simple, unobtrusive, and follows the UNIX tradition of single-purpose tools that do one thing well. This project was forked from rbenv and ruby-build, and modified for Python.

https://github.com/pyenv/pyenv

Install it via Homebrew:

$ brew update
$ brew install pyenv

It handles the download, compilation, and installation of various pythons for you, e.g.:

$ pyenv install 3.7.2

It can show you which versions you've installed, and which is active:

$ pyenv versions
  system
  3.6.7
* 3.7.2

When you're in a new project directory, just tell pyenv which python version to use there:

$ pyenv local 3.6.7  # Because tensorflow isn't compat. with 3.7 :-(

You can set a 'default' version everywhere else:

$ pyenv global 3.7.2

UPDATE, AUG 2024: I've gradually switched over to asdf because I work with a lot of different languages. The asdf project also publishes new version recipes very quickly. The asdf CLI interface is a little clunkier (verbose) because it can handle all languages. But pyenv never let me down for all the years I used it. If I was only doing Python development I might still be using it.

2 of 8
75

brew alone has been sufficient for me to use multiple versions of Python. I haven't needed pyenv or conda for it.

To install various versions using brew, run commands such as:

brew install [email protected]
brew install [email protected]

When creating a virtual environment, create it using one of:

/usr/local/opt/[email protected]/bin
/usr/local/opt/[email protected]/bin

Please list the bin directory above using ls in order to find and use the python executable in it.

For macOS M1 (not Intel) (see also, M1 brew setup), modify brew install path, eg:

/opt/homebrew/Cellar/[email protected]/bin

Please list the bin directory above using ls in order to find and use the python executable in it.

Lastly, the version of /usr/local/bin/python3 is probably not the version you want for your virtual environment.

🌐
Coding for Entrepreneurs
codingforentrepreneurs.com › blog › changing-default-python-3-in-terminal-for-mac-os
Changing Default Python 3 in Terminal for Mac OS
July 8, 2018 - Well, assuming you install the pkg version of Python (like Python 3.6.6) your install would be located in /Library/Frameworks/Python.framework/Versions/3.6 ... Save and close. Test Command After saving your ~/.bash_profile you have to open a new Terminal window for the changes to take place.
🌐
1 + 1 = 10
haccks.com › posts › install-multiple-python-versions-on-mac
How to install multiple Python versions on macOS? | 1 + 1 = 10
January 16, 2024 - python3.10, python3.11 and python3.12 respectively, in the terminal. You can make any these versions as the default python by running the sudo port select --set python3 python<version> command. You can use pip-<version> command to switch between pip for each version.
🌐
Opensource.com
opensource.com › article › 19 › 5 › python-3-default-mac
The right and wrong way to set Python 3 as default on a Mac | Opensource.com
My first idea on how to make Python 3 the default Python on my system was to move the old version and add the new one: # what I thought would work # first, I'll find my python binary $ which python /usr/bin/python # next, I'll move it to an unused name $ sudo mv /usr/bin/python /usr/bin/python2 # lastly, I'll move the new binary to the previous path $ sudo mv $PATHTOBINARY/python3 /usr/bin/python · The pattern followed what /usr/bin/ usually does between major releases of Python, but I quickly learned it was the wrong move: