Skip to content

Instantly share code, notes, and snippets.

@shamilbuzz
Created December 3, 2020 09:36
Show Gist options
  • Save shamilbuzz/f3444d1090b4bd30dc3e360cf2d153fa to your computer and use it in GitHub Desktop.
Save shamilbuzz/f3444d1090b4bd30dc3e360cf2d153fa to your computer and use it in GitHub Desktop.
MacOS Big Sur - Install Python 3.5-dev
#!/bin/bash
# Install xcode
xcode-select --install
# Install homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
brew update
# Install necessary dependencies
brew install openssl readline sqlite3 xz zlib
brew install [email protected]
export LDFLAGS="-L/usr/local/opt/zlib/lib"
export CPPFLAGS="-I/usr/local/opt/zlib/include
# Install pyenv
brew install pyenv
# For upgrading to latest version of pyenv
brew upgrade pyenv
# Setting important flags
set -ex
export CFLAGS="-I$(brew --prefix openssl)/include -I$(brew --prefix readline)/include -I$(xcrun --show-sdk-path)/usr/include"
export LDFLAGS="-L$(brew --prefix openssl)/lib -L$(brew --prefix readline)/lib -L$(xcrun --show-sdk-path)/usr/lib -L/usr/local/opt/zlib/lib"
export CPPFLAGS="-I/usr/local/opt/zlib/include"
export PKG_CONFIG_PATH="/usr/local/opt/zlib/lib/pkgconfig"
export SYSTEM_VERSION_COMPAT=1
pyenv install --patch 3.5-dev < <(curl -sSL https://github.com/python/cpython/commit/8ea6353.patch)
# Check avaialble version of python installed
pyenv install --list
@shamilbuzz
Copy link
Author

shamilbuzz commented Dec 3, 2020

SKIP respective installation if that is already installed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment