Skip to content

10.07 Poetry vs. uv (A Quick Aside on Tooling)

If you are following various tutorials online (or taking older AI courses), you might notice a discrepancy in how instructors set up their Python projects. Some use pip, some use poetry, and newer courses use uv.

As a beginner, this tooling landscape can feel overwhelming. Let's clarify what these tools are and why they matter (or don't matter) for learning LangGraph.


[!NOTE] Beginner's Concept: What is a Package Manager? When you write Python code, you rarely write everything from scratch. You download pre-written code packages (like langgraph or openai) to help you. A "Package Manager" is simply the app store for your project—it downloads the packages you need over the internet and keeps them organized so your project doesn't break.


1. The Core Point: It Doesn't Affect Your Code!

The most important thing to know is that whether you use Poetry or uv, your LangGraph Python code will look exactly the same.

These are strictly environment management tools. They are the scaffolding used to construct the building, not the building itself.

2. The Evolution of Python Package Managers

The Old Standard: pip and virtualenv

Historically, developers created a "virtual environment" (a sandbox for a specific project) and installed packages using pip install langgraph. This is simple but messy when projects get large and have complex dependencies (packages that rely on other specific versions of packages).

The Recent Standard: poetry

Poetry emerged as a better way to manage complex project dependencies. It uses a pyproject.toml file to carefully track the exact versions of every package your project needs. Many AI courses recorded in 2023 or early 2024 use Poetry.

The New Standard: uv

uv is a cutting-edge Python package and project manager written in Rust. It does everything pip and Poetry do, but it is astoundingly fast (often 10x to 100x quicker at installing packages).

If a tutorial uses poetry add langgraph but you are using uv, you can simply run uv pip install langgraph or uv add langgraph. The end result is identical: the package is installed in your project.


3. Langchain Environment Variables: V2 vs. Standard

You may also notice older tutorials asking you to set the following environment variable: LANGCHAIN_TRACING_V2=true

Newer tutorials ask for: LANGSMITH_TRACING=true

What's the difference?

There is no difference in functionality.

LangSmith is the observability platform (the debugging dashboard) for LangChain and LangGraph. In its early beta days, it was called "Tracing Version 2". When it officially launched as a polished product, it was rebranded to "LangSmith".

The developers updated the environment variable name to be more intuitive. - Use LANGSMITH_TRACING=true for modern projects. - (If it fails for some legacy reason, the older V2 variable still works as a fallback).

Summary

Do not get blocked by tooling differences! If you see poetry, feel free to translate it to uv (or standard pip if you prefer). If you see LANGCHAIN_TRACING_V2, just use LANGSMITH_TRACING.

Focus on the LangGraph graph architecture, not the package manager downloading it.