Skip to content

Instantly share code, notes, and snippets.

@drumnickydrum
Created June 12, 2023 17:21
Show Gist options
  • Save drumnickydrum/7c9a72bc717928cec0d2b9912a78af53 to your computer and use it in GitHub Desktop.
Save drumnickydrum/7c9a72bc717928cec0d2b9912a78af53 to your computer and use it in GitHub Desktop.
[Managing Python Env] Install pyenv and setup shell to manage versions #python #env
# Install pyenv, to manage Python versions
brew update
brew install pyenv
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc
echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc
echo 'eval "$(pyenv init -)"' >> ~/.zshrc
# Install the supported version of Python, as defined in .python-version
pyenv install
# Verify that you are using a supported version of Python
python --version # should be same as .python-version
# Activate virtual environment
source .venv/bin/activate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment