Pyenv - TwoGears/hakomo-guides GitHub Wiki

Setup and use PYENV

Installing Pyenv & virtualenv

real python guide: https://realpython.com/intro-to-pyenv/

official documentation: https://github.com/pyenv/pyenv

virtualenv: https://github.com/pyenv/pyenv-virtualenv

Using Pyenv

General commands

python -V - version of python

which python - which file is being used

pyenv install --list - list versions to install

pyenv versions - List versions on computer

Virtual Environments

pyenv virtualenv 3.10.2 my-virtual-env - create virtual env with specific version of python and name

pyenv activate my-virtual-env - activate virtual env

pyenv uninstall my-virtual-env - delete virtual env

pyenv local my-virtual-env - set environment as local - switch automatically if eval "$(pyenv virtualenv-init -)" is set in .bashrc