Created
June 12, 2023 17:21
-
-
Save codenickycode/7c9a72bc717928cec0d2b9912a78af53 to your computer and use it in GitHub Desktop.
[Managing Python Env] Install pyenv and setup shell to manage versions #python #env
This file contains hidden or 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
# 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