Multiple Python versions
Because one does not simply mess with MacOS default Python
Homebrew is a package manager for MacOS, must have CLI utility.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
MacOS comes with a python version but you should install the latest stable version of python.
brew install python
Download the
get-pip
filecurl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
Now run this file to install pip
python get-pip.py
sudo ln -s -f /usr/local/bin/python3.9 /usr/local/bin/python
pyenv
makes it easy to install, manage, and switch between multiple Pythons versions.brew install pyenv
pyenv install 3.9.4
pyenv install 2.7.16
pyenv global 3.9.4
pyenv versions
python -m venv venv
source ./venv/bin/activate
(venv) $ which python
To exit the virtual environment
deactivate
Last modified 1yr ago