Import error WRITES_IDX_MAP langgraph.checkpoint #221

Closed
opened 2026-02-20 17:32:24 -05:00 by yindo · 2 comments
Owner

Originally created by @HiraveBapu on GitHub (Sep 1, 2024).

Checked other resources

  • I added a very descriptive title to this issue.
  • I searched the LangGraph/LangChain documentation with the integrated search.
  • I used the GitHub search to find a similar question and didn't find it.
  • I am sure that this is a bug in LangGraph/LangChain rather than my code.
  • I am sure this is better as an issue rather than a GitHub discussion, since this is a LangGraph bug and not a design question.

Example Code

from langgraph.checkpoint.sqlite.aio import AsyncSqliteSaver

DB_NAME = "agent_memory.sqlite"
memory = AsyncSqliteSaver(aiosqlite.connect(DB_NAME))

Error Message and Stack Trace (if applicable)

python3.11/site-packages/langgraph/checkpoint/sqlite/__init__.py", line 9, in <module>
    from langgraph.checkpoint.base import (
ImportError: cannot import name 'WRITES_IDX_MAP' from 'langgraph.checkpoint.base' (/opt/miniconda3/envs/agent-dev/lib/python3.11/site-packages/langgraph/checkpoint/base/__init__.py)

Description

while importing AsyncSqliteSaver this error occurs

System Info

langchain-community = "^0.2.15"
langgraph = "^0.2.15"
langgraph-checkpoint-sqlite = "^1.0.1"
langchain-core = "^0.2.37"

Originally created by @HiraveBapu on GitHub (Sep 1, 2024). ### Checked other resources - [X] I added a very descriptive title to this issue. - [X] I searched the [LangGraph](https://langchain-ai.github.io/langgraph/)/LangChain documentation with the integrated search. - [X] I used the GitHub search to find a similar question and didn't find it. - [X] I am sure that this is a bug in LangGraph/LangChain rather than my code. - [X] I am sure this is better as an issue [rather than a GitHub discussion](https://github.com/langchain-ai/langgraph/discussions/new/choose), since this is a LangGraph bug and not a design question. ### Example Code ```python from langgraph.checkpoint.sqlite.aio import AsyncSqliteSaver DB_NAME = "agent_memory.sqlite" memory = AsyncSqliteSaver(aiosqlite.connect(DB_NAME)) ``` ### Error Message and Stack Trace (if applicable) ```shell python3.11/site-packages/langgraph/checkpoint/sqlite/__init__.py", line 9, in <module> from langgraph.checkpoint.base import ( ImportError: cannot import name 'WRITES_IDX_MAP' from 'langgraph.checkpoint.base' (/opt/miniconda3/envs/agent-dev/lib/python3.11/site-packages/langgraph/checkpoint/base/__init__.py) ``` ### Description while importing AsyncSqliteSaver this error occurs ### System Info langchain-community = "^0.2.15" langgraph = "^0.2.15" langgraph-checkpoint-sqlite = "^1.0.1" langchain-core = "^0.2.37"
yindo closed this issue 2026-02-20 17:32:26 -05:00
Author
Owner

@HiraveBapu commented on GitHub (Sep 1, 2024):

i think issue is here

import sqlite3
import threading
from contextlib import closing, contextmanager
from hashlib import md5
from typing import Any, AsyncIterator, Dict, Iterator, Optional, Sequence, Tuple

from langchain_core.runnables import RunnableConfig

from langgraph.checkpoint.base import (
    WRITES_IDX_MAP,
    BaseCheckpointSaver,
    ChannelVersions,
    Checkpoint,
    CheckpointMetadata,
    CheckpointTuple,
    EmptyChannelError,
    SerializerProtocol,
    get_checkpoint_id,
)

lib/python3.11/site-packages/langgraph/checkpoint/sqlite/__init__.py", line 9, in

@HiraveBapu commented on GitHub (Sep 1, 2024): i think issue is here ``` import sqlite3 import threading from contextlib import closing, contextmanager from hashlib import md5 from typing import Any, AsyncIterator, Dict, Iterator, Optional, Sequence, Tuple from langchain_core.runnables import RunnableConfig from langgraph.checkpoint.base import ( WRITES_IDX_MAP, BaseCheckpointSaver, ChannelVersions, Checkpoint, CheckpointMetadata, CheckpointTuple, EmptyChannelError, SerializerProtocol, get_checkpoint_id, ) ``` lib/python3.11/site-packages/langgraph/checkpoint/sqlite/__init__.py", line 9, in
Author
Owner

@nfcampos commented on GitHub (Sep 1, 2024):

You can update langgraph-checkpoint to 1.0.4 or above, which adds this import

@nfcampos commented on GitHub (Sep 1, 2024): You can update langgraph-checkpoint to 1.0.4 or above, which adds this import
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraph#221