Skip to content

Instantly share code, notes, and snippets.

@karlding
Last active June 2, 2020 03:45
Show Gist options
  • Select an option

  • Save karlding/18e47708942dd3c0ca1c4b3c6eac9dd9 to your computer and use it in GitHub Desktop.

Select an option

Save karlding/18e47708942dd3c0ca1c4b3c6eac9dd9 to your computer and use it in GitHub Desktop.

Revisions

  1. karlding created this gist Dec 31, 2017.
    40 changes: 40 additions & 0 deletions pyenv+virtualenv cheat sheet.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,40 @@
    # pyenv + virtualenvwrapper cheat sheet

    ## Requirements

    * [pyenv](https://github.com/pyenv/pyenv)
    * [pyenv-virtualenvwrapper](https://github.com/pyenv/pyenv-virtualenvwrapper)

    ## Usage

    Install new Python versions

    ```bash
    pyenv install 2.7.13
    ```

    Anytime we install a new Python version, we immediately install ``virtualenvwrapper``

    ```bash
    # switch versions
    pyenv shell 2.7.13

    # install virtualenvwrapper_lazy
    pyenv virtualenvwrapper_lazy
    ```

    Then to actually use the ``virtualenv``

    ```bash
    # create a new virtualenv
    mkvirtualenv my_environment

    # disable virtualenv
    deactivate

    # list all environments
    workon

    # reactivate virtualenv
    workon my_environment
    ```