Techiio-author
Started by Priyanka JalanApr 10, 2022

Open
How to install Python2.7 on latest MacOS

5 VIEWES 0 LIKES 0 DISLIKES SHARE
0 LIKES 0 DISLIKES 5 VIEWES SHARE

I am unable to install old python version 2.7, can someone please assist me?

1 Replies

Techiio-commentatorPritam Dhar replied a month ago0 likes0 dislikes

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)
https://www.python.org/downloads/release/python-2716/
# Add pip for python2.7
curl https://bootstrap.pypa.io/pip/2.7/get-pip.py -o get-pip2.py
python2 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
PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}"
export PATH
# 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
You must be Logged in to reply
Techiio-logo

Techiio is on the journey to build an ocean of technical knowledge, scouring the emerging stars in process and proffering them to the corporate world.

Follow us on:

Subscribe to get latest updates

You can unsubscribe anytime from getting updates from us
Developed and maintained by Wikiance
Developed and maintained by Wikiance