Skip to content

Instantly share code, notes, and snippets.

@rmbrntt
Last active August 26, 2020 19:52
Show Gist options
  • Save rmbrntt/546f9447e9dacc6752c3ba3004ec9a3e to your computer and use it in GitHub Desktop.
Save rmbrntt/546f9447e9dacc6752c3ba3004ec9a3e to your computer and use it in GitHub Desktop.

pyenv cheatsheet

pyenv

pyenv-virtualenv

Command reference

pyenv

pyenv install

List available python versions:

    $ pyenv install -l

Install Python 3.5.1:

    $ pyenv install 3.5.1
    $ pyenv rehash

pyenv versions

List installed versions:

    $ pyenv versions

pyenv local

Sets a local application-specific Python version:

    $ pyenv local 2.7.6

Unset the local version:

    $ pyenv local --unset

pyenv-virtualenv

Update bash/zshrc

    eval "$(pyenv init -)"
    eval "$(pyenv virtualenv-init -)"

List existing virtualenvs

    $ pyenv virtualenvs

Create virtualenv

From current version with name "venv35":

    $ pyenv virtualenv venv35

From version 2.7.10 with name "venv27":

    $ pyenv virtualenv 2.7.10 venv27

Activate/deactivate

    $ pyenv activate <name>
    $ pyenv deactivate

Delete existing virtualenv

    $ pyenv uninstall venv27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment