{"id":556,"library":"poetry-plugin-export","title":"Poetry Plugin: Export","description":"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.","status":"active","version":"1.10.0","language":"python","source_language":"en","source_url":"https://github.com/python-poetry/poetry-plugin-export","tags":["poetry","plugin","export","dependencies","requirements.txt","constraints.txt","pylock.toml","packaging","cli"],"install":[{"cmd":"poetry self add poetry-plugin-export","lang":"bash","label":"For Poetry versions < 2.0"},{"cmd":"pipx inject poetry poetry-plugin-export","lang":"bash","label":"If Poetry is installed via pipx"},{"cmd":"# In pyproject.toml for Poetry 2.0+:\n[tool.poetry.requires-plugins]\npoetry-plugin-export = \">=1.8\"","lang":"toml","label":"For Poetry 2.0+ (preferred method)"},{"cmd":"pip install poetry-plugin-export","lang":"bash","label":"If Poetry itself is installed via pip"}],"dependencies":[{"reason":"Core dependency for Poetry plugins; explicitly requires >=2.1.0,<3.0.0 as per plugin's pyproject.toml.","package":"poetry","optional":false},{"reason":"Core dependency for Poetry plugins; explicitly requires >=2.1.0,<3.0.0 as per plugin's pyproject.toml.","package":"poetry-core","optional":false},{"reason":"Requires Python versions >=3.10, <4.0.","package":"python","optional":false}],"imports":[],"quickstart":{"code":"# Assuming a pyproject.toml and poetry.lock exist in the current directory\n# and poetry-plugin-export is installed.\n\n# Export to a standard requirements.txt file\npoetry export -f requirements.txt --output requirements.txt\n\n# Export with development dependencies and without package hashes\npoetry export -f requirements.txt --output dev_requirements.txt --with dev --without-hashes\n\n# Export to a constraints.txt file including all dependency groups\npoetry export -f constraints.txt --output constraints.txt --all-groups","lang":"bash","description":"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`."},"warnings":[{"fix":"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+.","message":"As of Poetry 2.0, the `poetry export` command is no longer bundled by default with Poetry. Users must explicitly install `poetry-plugin-export` to regain this functionality.","severity":"breaking","affected_versions":"Poetry >= 2.0.0"},{"fix":"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.","message":"Python 3.9 support was dropped in `poetry-plugin-export` version 1.10.0. Python 3.8 support was dropped in 1.9.0, and Python 3.7 support in 1.5.0.","severity":"breaking","affected_versions":"1.10.0 (drops 3.9), 1.9.0 (drops 3.8), 1.5.0 (drops 3.7)"},{"fix":"Use `pip install -r requirements.txt --no-deps`.","message":"When installing an exported `requirements.txt` file via `pip`, always pass `--no-deps`. Poetry has already resolved all direct and transitive dependencies, and `pip` trying to re-resolve can lead to failures, especially with git dependencies.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Prefer using `--only <group>` to include only specific groups, or explicitly specify groups with `--with <group>`.","message":"The `--without` option for excluding dependency groups was deprecated in version 1.9.0. While still functional, it's recommended to use `--only` or explicitly list `--with` groups for clarity.","severity":"deprecated","affected_versions":">= 1.9.0"},{"fix":"Run `poetry lock` or `poetry update` to ensure `poetry.lock` is up-to-date and consistent before exporting.","message":"The plugin requires `poetry.lock` to be consistent with `pyproject.toml`. If the lock file is outdated, the export command might fail.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Update to the latest plugin version to benefit from fixes. Verify exported files in complex dependency scenarios.","message":"Editable installs and git dependencies have had issues with correct export in past versions. While some fixes were implemented (e.g., 1.8.0 for editable, 1.6.0 for git commit hashes), ensure your specific setup works as expected.","severity":"gotcha","affected_versions":"< 1.8.0 (editable), < 1.6.0 (git branches)"},{"fix":"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')`.","message":"Attempting to run `poetry` commands directly in a Python script (e.g., `poetry export -f requirements.txt`) without using `subprocess.run()` or `os.system()` will result in a `SyntaxError`.","severity":"breaking","affected_versions":"All versions"},{"fix":"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.","message":"Attempting to execute shell commands (like `poetry export ...`) directly in a Python script will result in a `SyntaxError`. Shell commands must be invoked using Python's `subprocess` module or by executing the script in a shell environment.","severity":"gotcha","affected_versions":"All Python versions"}],"env_vars":null,"last_verified":"2026-04-11T06:06:30.167Z","next_check":"2026-06-26T00:00:00.000Z","problems":[{"fix":"Install the plugin using `poetry self add poetry-plugin-export`.","cause":"The `export` command is no longer a built-in feature of Poetry 2.0 and later versions; it has been moved to the `poetry-plugin-export` and must be explicitly installed.","error":"The command \"export\" does not exist"},{"fix":"Ensure the plugin is installed with `poetry self add poetry-plugin-export`. To silence the warning after installation, run `poetry config warnings.export false`.","cause":"This is a 'future warning' from Poetry (typically versions 1.2.0 to <2.0.0) indicating that the `export` command, previously bundled, will no longer be part of the default Poetry installation in upcoming major versions. It may appear even if the plugin is already installed, as Poetry cannot distinguish between automatically and manually installed plugins for this warning.","error":"Warning: poetry-plugin-export will not be installed by default in a future version of Poetry. In order to avoid a breaking change and make your automation forward-compatible, please install poetry-plugin-export explicitly."},{"fix":"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.","cause":"The installed version of Poetry is incompatible with the version of `poetry-plugin-export` being attempted for installation; the plugin requires a newer Poetry version than what is currently present.","error":"Because no versions of poetry-plugin-export match >1.9.0,<2.0.0 and poetry-plugin-export (1.9.0) depends on poetry (>=2.0.0,<3.0.0), poetry-plugin-export (>=1.9.0,<2.0.0) requires poetry (>=2.0.0,<3.0.0). So, because poetry-instance depends on both poetry (1.8.2) and poetry-plugin-export (^1.9.0), version solving failed."},{"fix":"Install the plugin using `poetry self add poetry-plugin-export`.","cause":"The `poetry-plugin-export` is declared as a required plugin in your project's `pyproject.toml` file under `[tool.poetry.requires-plugins]`, but it has not been installed into Poetry's self-managed environment.","error":"Ensuring that the Poetry plugins required by the project are available... The following Poetry plugins are required by the project but are not installed in Poetry's environment: - poetry-plugin-export (>=1.8) Installing Poetry plugins only for the current project..."}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":0,"quickstart_tag":"stale","pypi_latest":null,"quickstart_checks":{"last_tested":"2026-04-23","tag":"stale","tag_description":"widespread failures or data too old to trust","results":[{"runtime":"python:3.10-alpine","exit_code":1},{"runtime":"python:3.10-slim","exit_code":1},{"runtime":"python:3.11-alpine","exit_code":1},{"runtime":"python:3.11-slim","exit_code":1},{"runtime":"python:3.12-alpine","exit_code":1},{"runtime":"python:3.12-slim","exit_code":1},{"runtime":"python:3.13-alpine","exit_code":1},{"runtime":"python:3.13-slim","exit_code":1},{"runtime":"python:3.9-alpine","exit_code":1},{"runtime":"python:3.9-slim","exit_code":1}]}}