Manage Python Projects With Poetry

Declare dependencies in pyproject.toml and lock them reproducibly.

macOSpackagespythonbuildLow risk
Run poetry init to create a pyproject.toml, then poetry add requests to add a dependency.

01Command

Command
$ poetry init

02What it does

Poetry reads pyproject.toml, resolves dependencies into a poetry.lock file and manages a project virtualenv. It can build and publish packages and runs scripts through poetry run, giving one tool for dependencies and packaging.

03Risk

RiskLow risk
CompatibilitymacOS with Homebrew installed
!Warning: Mixing Poetry with manually edited requirement files or a second resolver can produce inconsistent environments.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

  • Homebrew formula: poetry
    Homebrew · vendor-doc · 2026-09-20
    Evidence: Python package management tool. Packages Poetry, a Python dependency management and packaging tool.

Last verified: 2026-09-22 · Category: Developer

06Related solutions