Cheat Sheets - Version Management

Table of Contents

rbenv (Ruby)

List Ruby Versions

$ rbenv versions

gvm (Go)

pyenv (Python)

https://github.com/pyenv/pyenv

Installation (on macOS)

$ brew update
$ brew install pyenv

Activate (for Zsh)

$ echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n  eval "$(pyenv init -)"\nfi' >> ~/.zshrc

# restart the shell
$ exec "$SHELL"

Install a New Version of Python

$ pyenv install 3.7.9

# make it default
$ pyenv global 3.7.9

virtualenv (Python)

https://virtualenv.pypa.io/en/latest/

Installation

$ pip install virtualenv

Usage Example

$ mkdir python-envs

# python-envs/my-project-venv - could be any other folder
$ virtualenv python-envs/my-project-venv

$ source python-envs/my-project-venv/bin/activate