Skip to content

Instantly share code, notes, and snippets.

@gsong
Last active September 11, 2018 06:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gsong/d350274d96ef83ea48773ea6ef33ab0d to your computer and use it in GitHub Desktop.
Save gsong/d350274d96ef83ea48773ea6ef33ab0d to your computer and use it in GitHub Desktop.
Pyenv Setup Step-by-step
  1. Install pyenv using pyenv-installer:

    curl -L https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer | bash
  2. Activate pyenv for Terminal:

    echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile
    echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile
    echo 'eval "$(pyenv init -)"' >> ~/.bash_profile
  3. Exit and restart Terminal.

  4. Install Python:

    pyenv install 3.6.1
    pyenv global 3.6.1 system
  5. Exit and restart Terminal.

  6. Verify that you are now using the version of Python you just installed:

    python --version
  7. Install pyenv-virtualenvwrapper:

    git clone https://github.com/yyuu/pyenv-virtualenvwrapper.git ~/.pyenv/plugins/pyenv-virtualenvwrapper
  8. Activate pyenv-virtualenvwrapper for Terminal:

    echo 'export WORKON_HOME="$HOME/.virtualenvs"' >> ~/.bash_profile
    echo 'export PIP_VIRTUALENV_BASE="$WORKON_HOME"' >> ~/.bash_profile
    echo 'pyenv virtualenvwrapper_lazy' >> ~/.bash_profile
  9. Exit and restart Terminal.

  10. Set up the Django Girls Tutorial project:

    mkdir $HOME/djangogirls
    mkvirtualenv djangogirls -a $HOME/djangogirls
  11. Continue with setting up Django.

    Hint: You might have to scroll up due to a bug on the Django Girls website.

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