Skip to content

Instantly share code, notes, and snippets.

@PraneethKarnena
Last active June 4, 2024 06:47
Show Gist options
  • Save PraneethKarnena/8506b88a5a07e3e91358a66393f37176 to your computer and use it in GitHub Desktop.
Save PraneethKarnena/8506b88a5a07e3e91358a66393f37176 to your computer and use it in GitHub Desktop.
Installing Pyenv on macOS
sudo apt install build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev curl git libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev libsqlite3-dev wget libbz2-dev libedit-dev libncurses5-dev -y
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install openssl readline sqlite3 xz zlib
rm -rvf ~/.pyenv
git clone https://github.com/pyenv/pyenv.git ~/.pyenv
brew upgrade pyenv
# Add the below in .zshrc
#If you need to have openssl@1.1 first
export PATH="/usr/local/opt/openssl@1.1/bin:$PATH"
# For compilers to find openssl@1.1
export LDFLAGS="-L/usr/local/opt/openssl@1.1/lib"
export CPPFLAGS="-I/usr/local/opt/openssl@1.1/include"
# For pkg-config to find openssl@1.1
export PKG_CONFIG_PATH="/usr/local/opt/openssl@1.1/lib/pkgconfig"
# For compilers to find readline
export LDFLAGS="-L/usr/local/opt/readline/lib"
export CPPFLAGS="-I/usr/local/opt/readline/include"
# For pkg-config to find readline
export PKG_CONFIG_PATH="/usr/local/opt/readline/lib/pkgconfig"
# For compilers to find zlib
export LDFLAGS="-L/usr/local/opt/zlib/lib"
export CPPFLAGS="-I/usr/local/opt/zlib/include"
# For pkg-config to find zlib
export PKG_CONFIG_PATH="/usr/local/opt/zlib/lib/pkgconfig"
export PATH="/usr/local/opt/sqlite/bin:$PATH"
# For compilers to find sqlite
export LDFLAGS="-L/usr/local/opt/sqlite/lib"
export CPPFLAGS="-I/usr/local/opt/sqlite/include"
# For pkg-config to find sqlite
export PKG_CONFIG_PATH="/usr/local/opt/sqlite/lib/pkgconfig"
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init --path)"
eval "$(pyenv init -)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment