Skip to content

Poetry package manager

Installation

python3-poetry deb package is only available in ubuntu jammy and upwards. Until then:

brew install poetry

or

pip install poetry

Usage

Setup

Either create a new project (creates a new directory structure and files)

poetry new

or initialise an existing project (Creates a pyproject.toml file)

poetry init -n

Install packages

Add package:

poetry add pendulum

Install deps including the current project

poetry install

or only install dependencies from lock file

poetry install --no-root

Virtual envs

Show venv details:

poetry env info

Only show venv path:

poetry env info --path

Enable venv:

poetry env use python

Disable virtualenv:

poetry config virtualenvs.create false

Update poetry.lock:

poetry update

Container usage