Here is the pyenv cheat sheet of all the basic commands list.
What is pyenv
pyenv is Python version management tool, it lets you easily switch between multiple versions of Python.
What it does
Lets you change the global Python version on a per-user basis.
Provides support for per-project Python versions.
Allows you to override the Python version with an environment variable.
List available python versions to install
This will list all the available version of python
|
|
You can filter it using grep. Here we are filtering list by python version:
|
|
Installing Python Version
|
|
add -v
flag to see install progress output
List Installed Python Versions
|
|
Astrick (*) indicate current active version.
See List Of All pyenv Commands
|
|
Activating Python Version
global
Sets the given version as global python version.
It overrides system’s default python version.
|
|
local
Use it to set directory / project specific python version.
It can override python version set by
global
|
|
shell
Sets shell specific python version.
The python version stays active until shell has been closed or by using
--unset
flag.It can override python version set by
local
andglobal
|
|
Virtual Environments
Create Virtual Environments
|
|
Set virtual environment as default for dir/project
|
|
Activate Virtual Environment
|
|
Deactivate Virtual Environment
|
|
Recommended Reading Materials
Official Page of pyenv
Real Python: Managing Multiple Python Versions With pyenv