Python Versions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search

Internal

Overview

This page document how to deal with multiple Python versions on the same system. pyenv is a tool that deals with that.

brew install different Python major and minor versions in Cellar using the following naming scheme:

 Cellar
  ├─ ...
  ├─ python@3.8
  ├─ python@3.9
  ├─ python@3.10
  ├─ python@3.11
  ├─ python@3.12
  ├─ ...

Python Version Management with Brew

Install a Specific Version

Update a Specific Version to a Newer Patch Level

pip relationship to Python Version

Multiple Python Versions

Installs in /usr/local/Cellar/python@3.7 while preserving the current /usr/local/Cellar/python@3.9.

This version is not symlinked in /usr/local/bin. To use it:

export PATH="/usr/local/opt/python@3.7/bin:${PATH}"