Last active
June 4, 2024 06:47
Installing Pyenv on macOS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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