To add a question to the great question and discussion here on pyenv, venv, virtualenv, and virtualenvwrapper, could someone please explain how Conda environments fit into this world? When are the preferred use cases for Conda environments vs the other virtual environment options?
Update to question in November 2024: how do Poetry and Docker fit into this world?
Here is how everything fits together. We'll start with the problems the various tools are solving. Then cover how each tool slots in.
Dependency Managers. Problem these tools solve:
Dependency/Package Managers solve the above questions for us.
Environment Managers. Problems these solve:
Environment managers create and manage "virtual environments", which allow each project to have its own set of packages/python versions installed.
How do all the tools fit in? Some confusion is often caused by overlap in the tooling. Here is how they map:
How does Docker fit in? Docker provides environment and dependency management, and also provides operating system management. For example, a Docker container can allow one project to operate on a Fedora Linux distribution, and another project to use Ubuntu. Docker can also be mixed and matched with the above tools, e.g. Docker handles the operating system management, but calls Poetry to handle environment and dependency management. Docker can also manage other dependencies too, like network settings, system libraries, etc.
When to Use What?
Hope this helps everyone save a bunch of time understanding how all these tools fit together.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With