Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[macOS] Install Python2 from pkg installer #2217

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions images/macos/provision/core/python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@ echo "Installing Python Tooling"
echo "Brew Installing Python 3"
brew install [email protected]

echo "Brew Installing Python 2"
# Create local tap with formula due to python2 formula depreciation
brew tap-new --no-git local/python2
FORMULA_PATH=$(brew extract python@2 local/python2 | grep "Homebrew/Library/Taps")
brew install $FORMULA_PATH
echo "Install latest Python 2"
Python2Url="https://www.python.org/ftp/python/2.7.18/python-2.7.18-macosx10.9.pkg"
download_with_retries $Python2Url "/tmp" "python2.pkg"
sudo installer -pkg /tmp/python2.pkg -target /
pip install --upgrade pip

echo "Install Python2 certificates"
bash -c "/Applications/Python\ 2.7/Install\ Certificates.command"
maxim-lobanov marked this conversation as resolved.
Show resolved Hide resolved

echo "Installing pipx"
export PIPX_BIN_DIR=/usr/local/opt/pipx_bin
Expand All @@ -21,4 +24,4 @@ brew install pipx

echo "export PIPX_BIN_DIR=${PIPX_BIN_DIR}" >> "${HOME}/.bashrc"
echo "export PIPX_HOME=${PIPX_HOME}" >> "${HOME}/.bashrc"
echo 'export PATH="$PIPX_BIN_DIR:$PATH"' >> "${HOME}/.bashrc"
echo 'export PATH="$PIPX_BIN_DIR:$PATH"' >> "${HOME}/.bashrc"