How to install LangGraph with pip

Long-running agents often need durable execution, branching, streaming, or human checkpoints rather than a single model call. LangGraph provides the low-level graph runtime and a Python Graph API without requiring a model provider or API key.

The package is published on PyPI as langgraph and requires Python 3.10 or newer. An isolated .venv keeps its dependencies out of the system Python installation and makes the active interpreter unambiguous.

The base install is enough to import StateGraph and build model-free graphs. Model providers and higher-level LangChain agent components use separate packages, so install them only when a project needs them.

Steps to install LangGraph with pip:

  1. Confirm that Python 3.10 or newer is available.
    $ python3 --version
    Python 3.14.4
  2. Create an isolated project environment in .venv.
    $ python3 -m venv .venv
  3. Activate the .venv environment for the current shell.
    $ source .venv/bin/activate
  4. Install the current LangGraph package from PyPI.
    $ python -m pip install --upgrade langgraph

    The --upgrade option installs LangGraph when it is absent and updates an older copy in the active environment.

  5. Inspect the installed langgraph package metadata.
    $ python -m pip show langgraph
    Name: langgraph
    Version: 1.2.9
    Summary: Building stateful, multi-actor applications with LLMs
    ##### snipped #####
    Location: /home/alex/project/.venv/lib/python3.14/site-packages
    Requires: langchain-core, langgraph-checkpoint, langgraph-prebuilt, langgraph-sdk, pydantic, xxhash

    The version and Python directory change over time. The Location value should point inside the project's .venv directory.

  6. Import StateGraph with the active environment's Python interpreter.
    $ python -c "from langgraph.graph import StateGraph; print(StateGraph)"
    <class 'langgraph.graph.state.StateGraph'>