Poetry
Poetry is a packaging and dependency manager for Python that uses pyproject.toml to define project metadata and dependencies, provides a lock file for repeatable installs, and can build and publish distributions.
Installation and Setup
Poetry requires Python 3.9 or newer and runs on Linux, macOS, and Windows. Here’s how to install it:
Verfy the installation:
$ poetry --version
Poetry (version 2.2.0)
Key Features
- Supports
pyproject.tomlconfiguration for metadata and dependencies, with a PEP 517 build backend viapoetry-core. - Implements reproducible installs using a
poetry.lockfile that records exact versions. - Integrates environment management to creates or detects virtual environments and supports
poetry runto invoke tools. - Provides publishing workflows to build wheels and sdists and to publish to PyPI or private indexes.
- Supports plugins to customize functionality.
Usage
Create a new project or configure an existing one:
$ poetry new project_name
$ cd existing_project
$ poetry init
Add and install dependencies:
$ poetry add requests
$ poetry install
Run tools inside the managed environment:
$ poetry run pytest
Update locked dependencies:
$ poetry update
Build and publish a distribution to PyPI:
$ poetry build
$ poetry publish
These commands operate on pyproject.toml and poetry.lock to manage packages and produce wheel and sdist artifacts.
Related Resources
Tutorial
Dependency Management With Python Poetry
Learn how Python Poetry will help you start new projects, maintain existing ones, and master dependency management.
For additional information on related topics, take a look at the following resources:
By Leodanis Pozo Ramos • Updated Nov. 28, 2025