poetry-dotenv-plugin
A Poetry plugin to automatically load environment variables from .env files
What it is and what it does
Poetry Dotenv Plugin is a Poetry plugin that automatically injects environment variables from `.env` files into the environment before Poetry commands execute. It wraps python-dotenv to handle variable expansion and interpolation, making it a drop-in replacement for users migrating from Pipenv who relied on automatic `.env` loading. The plugin integrates via Poetry's event handler system and can be controlled through environment variables like POETRY_DOTENV_LOCATION and POETRY_DONT_LOAD_ENV, mirroring Pipenv's interface for ease of transition.
The plugin is lightweight, requiring only Poetry and python-dotenv as runtime dependencies. It supports Python 3.7 and later, and by default overrides existing environment variables—though this can be disabled by setting POETRY_DOTENV_DONT_OVERRIDE to true. Installation is straightforward via `poetry self add`, and it requires no additional configuration beyond having a `.env` file in your project.
Use it for:
- Migrating from Pipenv to Poetry while preserving existing `.env` loading workflows without code changes.
- Automatically loading development secrets and configuration from `.env` files during local Poetry runs.
- Using POSIX variable expansion in `.env` files (e.g., `${VAR}` syntax) via python-dotenv's interpolation support.
- Controlling `.env` loading behavior per project using POETRY_DOTENV_LOCATION and POETRY_DONT_LOAD_ENV environment variables.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A Poetry plugin that automatically loads environment variables from `.env` files before Poetry commands run, delegating to python-dotenv for variable expansion and interpolation.
Yes, if you use Poetry and rely on `.env` files for local development. The plugin is simple, low-friction to install, and solves a common workflow gap for Pipenv users switching to Poetry. However, note that maintenance is dormant (last release July 2023); if you need active support or compatibility with very recent Poetry versions, verify compatibility first or consider alternatives.
Install
poetry-dotenv-plugin on PyPI
pip
pip install poetry-dotenv-pluginuv
uv add poetry-dotenv-pluginpoetry
poetry add poetry-dotenv-pluginInstalling poetry-dotenv-plugin
Before you install
Low friction: pure Python wheel with only two runtime dependencies (poetry and python-dotenv). Maintenance is dormant—last release was 2023-07-16, over a year ago, though the repo remains active with no archived flag and a recent commit on 2024-07-19.
License in practice
MIT license (permissive) places no restrictions on use, modification, or distribution in your own projects.
Quickstart
poetry self add poetry-dotenv-plugin
# Then in your project with a .env file:
poetry run python -c 'import os; print(os.environ.get("MY_ENV_VAR"))'
Requires Poetry to be installed and a `.env` file present in your project directory.
Verify before relying
- Whether the plugin works correctly with Poetry versions released after 2024-07-19 (last commit date).
- Current compatibility with the latest python-dotenv release and any breaking changes in its API.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.7,<4) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — poetry, python-dotenv |
| Maintenance | dormant — 1,125 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 141,326/month — #11,242 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: poetry_dotenv_plugin-0.2.0-py3-none-any.whl
Keywords: poetry, poetry-plugin, plugin, dotenv
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
load-dotenvAutomatically loads environment variables from…
permissive · top 15,000 on PyPI
migrate-to-uvAutomates migration of Python projects from…
permissive · top 15,000 on PyPI
pytest-dotenvA pytest plugin that automatically loads…
permissive · top 5,000 on PyPI
python-dotenvReads key-value pairs from a .env file and sets…
permissive · top 100 on PyPI
dotenvLoads environment variables from a .env file…
unclear · top 5,000 on PyPI
pytest-envA pytest plugin that loads environment…
permissive · top 1,000 on PyPI
django-dotenvLoads environment variables from a .env file…
permissive · top 15,000 on PyPI
dump-envGenerates .env files by merging an…
permissive · top 15,000 on PyPI
pipenvPipenv automates Python virtual environment…
permissive · top 1,000 on PyPI
expandvarsExpands Unix-style variable references in…
permissive · top 5,000 on PyPI