Last active
March 27, 2018 19:24
-
-
Save zlove/8533b00523af7d3fb1537a5e47608a6c to your computer and use it in GitHub Desktop.
pyenv and pyenv virtualenv cheatsheet. This is not at all comprehensive - just a reminder for common tasks.
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
# Show locally installed Python versions. With pyenv virtualenv installed this | |
# also lists local virtualenvs | |
pyenv versions | |
# List Python versions which are available to install | |
pyenv install --list | |
# Install Python version 2.7.14. See `pyenv install --list` for available <versions> | |
pyenv install <version> | |
# E.g. | |
pyenv install 2.7.14 | |
# Create a new virtualenv with pyenv virtualenv | |
pyenv virtualenv <version> <virtualenv name> | |
# E.g. | |
pyenv virtualenv 2.7.14 awesome-env | |
# Configure a directory to automatically activate a virtualenv | |
cd /path/to/my/repo | |
echo 'awesome-env' > .python-version |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment