Poetry — A Python Developer’s New BFF

How Python’s Hot New Dependency Manager Will Save You From Dependency Hell

Hey folks, today I want to chat about Poetry—the nifty new Python dependency and package manager that’s got me excited. I know, I know, not the most thrilling topic. But stick with me! This stuff matters if you ever want to stop pulling your hair out over failed installations and messy virtual environments.

Let’s start from the beginning. So you want to install a cool new Python package for your latest project? You could just pip install whatever it is. But that clutters up your system's Python installation. No bueno! Instead, you create a virtual environment (good call!) and activate it. Then you install the package there. Crisis averted🙌.

But what happens when you share your code? Uh oh, your teammates don’t have those packages you meticulously installed! So you scramble to document each and every one. We’ve all been there. Poetry offers a better way.

Poetry lets you declare all your project dependencies in one place—the poetry.lock file. Anyone can reproduce your venv with a single command:

poetry install

How does it know what to install? Poetry uses pyproject.toml for config. Here’s a simple example:

[tool.poetry]
name = "my-cool-project"
version = "0.1.0"
description = "Something awesome"
authors = ["Your Name <you@email.com>"]

[tool.poetry.dependencies]
python = "^3.8"
pandas = "^1.1"

[tool.poetry.dev-dependencies]
pytest = "^5.2"

Sweet and simple. Poetry takes care of the rest — virtual environments, package installation, all of it!

Other handy features:

  • Automatic virtual environment activation
  • Tools for publishing and distributing packages
  • Convenient commands like poetry add and poetry remove

So say goodbye to Dependency HellTM and hello to poetry! Your future Python project will thank you. Give this nifty tool a spin and level up your Python game today.

Let me know if this helps explain why poetry could be your new Python BFF! What other development tools make your life easier? I want to hear all your hot takes. even PEP 518 vs. PDM. Yeah, I went there! Catch you in the comments 😁

Liked the author? Connect with Khushiyant

Let’s be friends! You can find me on Twitter, and LinkedIn. Interested in having me speak at your event? Comment Below

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Khushiyant
Khushiyant

Written by Khushiyant

Data Scientist @Turing| Research Assistant, NTNU, Norway | Remote Developer | Building @Keribium | OpenSource Developer @zulip @unifyai | SIH’22 Winner

No responses yet

Write a response