Mac - Installing Python3¶
To install Python3:¶
-
Ensure Homebrew is installed.
-
Run the following commands to install dependencies, set up Pyenv, and configure the shell to initialize Pyenv on startup:
brew install openssl readline sqlite3 xz zlib brew install pyenv if [[ "$SHELL" == *zsh ]]; then SDE_SHELL_PROFILE=$HOME/.zshrc; else export SDE_SHELL_PROFILE=$HOME/.bash_profile; fi echo 'eval "$(pyenv init --path)"' >>$SDE_SHELL_PROFILE source $SDE_SHELL_PROFILE
-
Run the following commands to install a supported version of Python 3 (version 3.9, or later):
pyenv install 3.10.8 pyenv global 3.10.8
-
Run the following command to install pip3:
python3 -m ensurepip