Poetry: Package manager

Poetry is a tool for dependency management

Patrick Rachford
1 min readFeb 1


[Poetry] allows you to declare the libraries your project depends on and it will manage (install/update) them for you. Poetry offers a lockfile to ensure repeatable installs, and can build your project for distribution.


To install, run the following in your terminal.

curl -sSL https://install.python-poetry.org | python3


To upgrade, run the following in your terminal.

poetry self update

Enable tab completion

To enable tab completion with Bash, run the following in your terminal.

poetry completions bash >> ~/.bash_completion

Create a new project

To create a new project, use the newcommand followed by the project’s name.

poetry new my-project

This creates a new project.

├── pyproject.toml
├── README.md
├── my-project
│ └── __init__.py
└── tests
└── __init__.py

The pyproject.toml will look like the following.

name = "my-project"
version = "0.1.0"
description = ""
authors = ["Your name <email@example.io>"]
readme = "README.md"
packages = [{include = "my-project"}]
python = "³.7"
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

Execute code

To execute code with Poetry, run the following command.

poetry run python your_app.py



Patrick Rachford

Currently at Temporal, previously at AWS. I enjoy documenting my thoughts and sharing ideas with others.