Better Python project management with Poetry

With Poetry, Python finally has a graceful way to manage virtual environments and dependencies for development projects. Here’s how to get started

“There should be one — and preferably only one — obvious way to do it.”

While that line comes from Tim Peters’s Zen of Python, Python doesn’t always adhere to that principle. One area where Python has fallen short of that ideal is project management. For too long, managing Python projects has involved a mishmash of tools and methodologies. However, a de facto standard may be emerging—Poetry.

Poetry brings to Python the kind of all-in-one project management tool that Go and Rust have long enjoyed. Poetry allows projects to have deterministic dependencies with specific package versions, so they build consistently in different places. Poetry also makes it easier to build, package, and publish projects and libraries to PyPI, so others can share the fruits of your Python labors.

In this article, we’ll walk through the use of Poetry for Python development projects — how to set up Poetry, how to use Poetry to configure a project’s dependencies and virtual environment, and how to avoid some of the pitfalls that come with Poetry’s unique way of doing things.

Set up Poetry in Python

To continue reading this article register now