poetry-plugin-export is an official Poetry plugin, currently at version 1.10.0, that extends Poetry's functionality by providing an `export` command. This command allows users to convert locked dependencies from `poetry.lock` files into various standardized formats such as `requirements.txt`, `constraints.txt`, and `pylock.toml`. It aims to eventually replace the functionality of Poetry's built-in `export` command (which is no longer bundled by default in Poetry 2.0+). The plugin is actively maintained, with releases tied to the evolution of Poetry itself.
poetry self add poetry-plugin-exportNo compatibility data collected yet for this library.
The plugin provides an `export` command that integrates directly into the Poetry CLI. You can specify the output format, file, and control which dependency groups are included or excluded. The most common use case is generating a `requirements.txt` for environments that rely on `pip`.
Install the plugin using `poetry self add poetry-plugin-export` (for older plugin installation methods) or declare it as a required plugin in `pyproject.toml` under `[tool.poetry.requires-plugins]` for Poetry 2.0+.
Ensure your project's Python environment meets the plugin's `requires-python` constraint, which is currently `>=3.10,<4.0` for version 1.10.0.
Use `pip install -r requirements.txt --no-deps`.
Prefer using `--only <group>` to include only specific groups, or explicitly specify groups with `--with <group>`.
Run `poetry lock` or `poetry update` to ensure `poetry.lock` is up-to-date and consistent before exporting.
Update to the latest plugin version to benefit from fixes. Verify exported files in complex dependency scenarios.
Execute `poetry` commands from a Python script using `subprocess.run(['poetry', 'export', '-f', 'requirements.txt', '--output', 'requirements.txt'], check=True)` or `os.system('poetry export -f requirements.txt --output requirements.txt')`.To run shell commands from within a Python script, use `subprocess.run(['poetry', 'export', '-f', 'requirements.txt', '--output', 'requirements.txt'], check=True)` or ensure the command is executed directly in your shell/terminal.
Install the plugin using `poetry self add poetry-plugin-export`.
Ensure the plugin is installed with `poetry self add poetry-plugin-export`. To silence the warning after installation, run `poetry config warnings.export false`.
Update Poetry to a compatible version (e.g., `poetry self update`) before installing the plugin, or specify a plugin version that is compatible with your current Poetry installation.
Install the plugin using `poetry self add poetry-plugin-export`.