Reference doc for some good articles on python virtual environment tools; along with lists and links for the common version, virtual environment and package management tools.
Articles
- Real Python - Python Virtual Environments: A Primer
- Real Python - An Effective Python Environment
- Good discussion of shells and terminals, as well as tools for managing python virtual environments
- Pluralsight Tech Blog - Managing Python Environments
- Dev - Python Tools for Managing Virtual Environments
Python Version Management
- pyenv
- conda - Anaconda/Miniconda
- I initially started developing in Python using the Anaconda distribution, hence tend to use conda to manage environments
Virtual Environments
- venv
- pyenv virtualenv
- virtualenv
- conda
- pipenv
- Has concept of
Pipfile
andPipfile.lock
- Has concept of
Package Management
Direnv
[direnv:https://direnv.net/]
direnv is an extension for your shell. It augments existing shells with a new feature that can load and unload environment variables depending on the current directory.
direnv can be used to activate a particular Python version/virtual environment when you cd into a directory. Thus, a virtualenv can be created for a project, which is activated each time you go into the repo.
Note that there currently isn’t a way to specify what happens when you leave the directory (e.g. deactivate the virtual environment), but there is an open issue on GitHub covering this.