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.
| Directory | Path | Pros | Cons |
|---|---|---|---|
| Project directory | ./venv | Straightforward and easy to manage. | - Should be added to .gitignore- Bloated project directory |
| User directory | ~/.virtualenvs | Manage 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
virtualenvif 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