You can use these three steps
1) Install Python 2, enter: brew install python@2.
2) Make sure the Python command points to the latest Python you installed with Homebrew: ls -l `
which python` ...
3) Check that your installed Python version is running, enter the python --version. The system should
respond with version number, 2.7.
python, python2 -> python 2.7
# Download/run the legacy macOS installer (pick which one for your sys)
# Add pip for python2.7
curl https://bootstrap.pypa.io/pip/2.7/get-pip.py -o get-pip2.py
# Optionally check for pip updates (in case of post-eol patches)
python2 -m pip install --upgrade pip
# Optionally add the helpers like easy_install back onto your path
# In your ~/.zprofile or whatever bash/shell profile equivalent
# Optionally add some helpers while editing shell profile
alias pip2="python2 -m pip"
alias venv2="virtualenv -p python2"
alias venv3="virtualenv -p python3"
# Optionally some apple-specific std libraries are missing, search
# and download them. Example: plistlib.py
curl https://raw.githubusercontent.com/python/cpython/2.7/Lib/plistlib.py -o /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plistlib.py
# Lastly, there is no symlink /usr/bin/python anymore
# /usr/bin is system protected so you can't add one either
# Change your programs to use /usr/local/bin/python
# or google how to disable macOS SIP to make a symlink in /usr/bin