pyenv

Table of Contents

Reference

local

$ pyenv local 2.7.6
$ pyenv local --unset
$ pyenv local 2.7.6 3.3.3

global

$ pyenv global 2.7.6

shell

$ pyenv shell pypy-2.2.1
$ pyenv shell --unset

install

$ pyenv install 2.7.6
$ pyenv install 2.6.8
$ pyenv install --list

version

$ pyenv version
2.7.6 (set by /home/yyuu/.pyenv/version)

$ pyenv versions
  2.5.6
  2.6.8
* 2.7.6 (set by /home/yyuu/.pyenv/version)
  3.3.3
  jython-2.5.3
  pypy-2.2.1

which

$ pyenv which python3.3
/home/yyuu/.pyenv/versions/3.3.3/bin/python3.3

whence

$ pyenv whence 2to3
2.6.8
2.7.6
3.3.3

virtualenv

$ pyenv virtualenv 2.7.10 my-virtual-env-2.7.10  # specify a version for venv
$ pyenv my-virtual-env # based on current pyenv version

$ pyenv version
3.4.3 (set by /home/yyuu/.pyenv/version)
$ pyenv virtualenv venv34
$ pyenv virtualenvs
  miniconda3-3.9.1 (created from /home/yyuu/.pyenv/versions/miniconda3-3.9.1)
  miniconda3-3.9.1/envs/myenv (created from /home/yyuu/.pyenv/versions/miniconda3-3.9.1)
  2.7.10/envs/my-virtual-env-2.7.10 (created from /home/yyuu/.pyenv/versions/2.7.10)
  3.4.3/envs/venv34 (created from /home/yyuu/.pyenv/versions/3.4.3)
  my-virtual-env-2.7.10 (created from /home/yyuu/.pyenv/versions/2.7.10)
* venv34 (created from /home/yyuu/.pyenv/versions/3.4.3)

$ pyenv activate <name>
$ pyenv deactivate

$ pyenv uninstall my-virtual-env

How-to

Fix common build problems