Skip to main content

Virtual Environment

A brief overview of various environment tools available for Python.

venv

  • Standard library module for creating lightweight virtual environments.
  • Built-in module in Python 3.3 and later.
python3 -m venv path-to-env
tip

Think about where you'd like to store your virtual environments.

DirectoryPathProsCons
Project directory./venvStraightforward and easy to manage.- Should be added to .gitignore
- Bloated project directory
User directory~/.virtualenvsManage virtual environments in one place- May pile up over time
- Easy to forget to delete after project completion

virtualenv

  • The predecessor of venv.
  • Now offers as a more feature-rich edition of venv.
  • Use virtualenv if you need to...
    • Faster environment setup.
    • More control over the environment.

pipenv

TODO

poetry

TODO

pdm

TODO

hatch

TODO

uv

TODO

rye

TODO

dephell

TODO