Pyenv is a popular option in Python applications. Pyenv allows you to manage different versions of Python in your application and also on your system.
Pyenv does not officially support Windows but you can use WSL (Windows Subsystem for Linux).
For more information visit: pyenv repository
Installation:
You can install using Homebrew or make a manual installation:
Using Homebrew:
brew install pyenv
Manual Installation:
Download pyenv:
curl https://pyenv.run | bash
Let’s edit your bash profile:
nano .bashrc
Add these lines in the end of the document:
export PYENV_ROOT=“$HOME/.pyenv”
export PATH=“$PYENV_ROOT/bin:$PATH“
eval “$(pyenv init –path)“
Creating a Virtual Environment:
Activating the Virtual Environment:
Deactivating the Virtual Environment:
Managing Python Versions:
Pyenv allows you to manage python versions, here is a simple tutorial that you can use in your application or in your input system:
List available versions:
Install a version:
Defining a version:
pyenv local <version> # set a local version