Poetry: Python Dependency Management

2.3.2 · active · verified Sat Mar 28

Poetry is a comprehensive tool for Python dependency management and packaging, leveraging `pyproject.toml` for configuration and a `poetry.lock` file for consistent, reproducible environments. It handles dependency resolution, virtual environment management, and project building. The current version is 2.3.2, with frequent minor and patch releases, though without a fixed release cycle.

Warnings

Install

Quickstart

Initialize a new Poetry project, add dependencies, install them into a managed virtual environment, and execute commands within that environment.

# 1. Create a new project
poetry new my-project

# 2. Navigate into the project directory
cd my-project

# 3. Add a dependency
poetry add requests

# 4. Install project dependencies (creates virtual environment if needed)
poetry install

# 5. Run a command within the project's virtual environment
poetry run python -c "import requests; print('Requests is installed!')"

view raw JSON →