sqlite checkpointer import error #244

Closed
opened 2026-02-20 17:33:35 -05:00 by yindo · 6 comments
Owner

Originally created by @openSourcerer9000 on GitHub (Sep 24, 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 import SqliteSaver

Error Message and Stack Trace (if applicable)

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
Cell In[46], line 1
----> 1 from langgraph.checkpoint.sqlite import SqliteSaver
      2 # SqliteSaver.config_specs

File ...\Lib\site-packages\langgraph\checkpoint\sqlite\__init__.py:9
      5 from typing import Any, AsyncIterator, Dict, Iterator, Optional, Sequence, Tuple
      7 from langchain_core.runnables import RunnableConfig
----> 9 from langgraph.checkpoint.base import (
     10     WRITES_IDX_MAP,
     11     BaseCheckpointSaver,
     12     ChannelVersions,
     13     Checkpoint,
     14     CheckpointMetadata,
     15     CheckpointTuple,
     16     SerializerProtocol,
     17     get_checkpoint_id,
     18 )
     19 from langgraph.checkpoint.serde.jsonplus import JsonPlusSerializer
     20 from langgraph.checkpoint.serde.types import ChannelProtocol

ImportError: cannot import name 'WRITES_IDX_MAP' from 'langgraph.checkpoint.base'```

Description

Checkpointing is broken- something broke with internal import statements.

This documentation is also out of date: https://langchain-ai.github.io/langgraph/reference/checkpoints/#sqlitesaver

System Info

System Information

OS: Windows
OS Version: 10.0.19045
Python Version: 3.11.8 | packaged by conda-forge | (main, Feb 16 2024, 20:40:50) [MSC v.1937 64 bit (AMD64)]

Package Information

langchain_core: 0.2.34
langchain: 0.2.12
langchain_community: 0.2.11
langsmith: 0.1.127
langchain_cli: 0.0.29
langchain_ollama: 0.1.1
langchain_openai: 0.1.22
langchain_text_splitters: 0.2.2
langgraph: 0.2.3
langserve: 0.2.2

Other Dependencies

aiohttp: 3.10.1
async-timeout: 4.0.3
dataclasses-json: 0.6.7
fastapi: 0.112.0
gitpython: 3.1.43
httpx: 0.27.0
jsonpatch: 1.33
langgraph-checkpoint: 1.0.11
langserve[all]: Installed. No version info available.
libcst: 1.4.0
numpy: 1.26.4
ollama: 0.3.1
openai: 1.40.1
orjson: 3.10.6
packaging: 24.1
pydantic: 2.8.2
pyproject-toml: 0.0.10
PyYAML: 6.0.1
requests: 2.31.0
SQLAlchemy: 2.0.32
sse-starlette: 1.8.2
tenacity: 8.5.0
tiktoken: 0.7.0
tomlkit: 0.12.5
typer[all]: Installed. No version info available.
typing-extensions: 4.11.0
uvicorn: 0.23.2

Originally created by @openSourcerer9000 on GitHub (Sep 24, 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 import SqliteSaver ``` ### Error Message and Stack Trace (if applicable) ```shell --------------------------------------------------------------------------- ImportError Traceback (most recent call last) Cell In[46], line 1 ----> 1 from langgraph.checkpoint.sqlite import SqliteSaver 2 # SqliteSaver.config_specs File ...\Lib\site-packages\langgraph\checkpoint\sqlite\__init__.py:9 5 from typing import Any, AsyncIterator, Dict, Iterator, Optional, Sequence, Tuple 7 from langchain_core.runnables import RunnableConfig ----> 9 from langgraph.checkpoint.base import ( 10 WRITES_IDX_MAP, 11 BaseCheckpointSaver, 12 ChannelVersions, 13 Checkpoint, 14 CheckpointMetadata, 15 CheckpointTuple, 16 SerializerProtocol, 17 get_checkpoint_id, 18 ) 19 from langgraph.checkpoint.serde.jsonplus import JsonPlusSerializer 20 from langgraph.checkpoint.serde.types import ChannelProtocol ImportError: cannot import name 'WRITES_IDX_MAP' from 'langgraph.checkpoint.base'``` ``` ### Description Checkpointing is broken- something broke with internal import statements. This documentation is also out of date: https://langchain-ai.github.io/langgraph/reference/checkpoints/#sqlitesaver ### System Info System Information ------------------ > OS: Windows > OS Version: 10.0.19045 > Python Version: 3.11.8 | packaged by conda-forge | (main, Feb 16 2024, 20:40:50) [MSC v.1937 64 bit (AMD64)] Package Information ------------------- > langchain_core: 0.2.34 > langchain: 0.2.12 > langchain_community: 0.2.11 > langsmith: 0.1.127 > langchain_cli: 0.0.29 > langchain_ollama: 0.1.1 > langchain_openai: 0.1.22 > langchain_text_splitters: 0.2.2 > langgraph: 0.2.3 > langserve: 0.2.2 Other Dependencies ------------------ > aiohttp: 3.10.1 > async-timeout: 4.0.3 > dataclasses-json: 0.6.7 > fastapi: 0.112.0 > gitpython: 3.1.43 > httpx: 0.27.0 > jsonpatch: 1.33 > langgraph-checkpoint: 1.0.11 > langserve[all]: Installed. No version info available. > libcst: 1.4.0 > numpy: 1.26.4 > ollama: 0.3.1 > openai: 1.40.1 > orjson: 3.10.6 > packaging: 24.1 > pydantic: 2.8.2 > pyproject-toml: 0.0.10 > PyYAML: 6.0.1 > requests: 2.31.0 > SQLAlchemy: 2.0.32 > sse-starlette: 1.8.2 > tenacity: 8.5.0 > tiktoken: 0.7.0 > tomlkit: 0.12.5 > typer[all]: Installed. No version info available. > typing-extensions: 4.11.0 > uvicorn: 0.23.2
yindo closed this issue 2026-02-20 17:33:35 -05:00
Author
Owner

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

Your dependency list suggests you don't have langgraph-checkpoint-sqlite installed but are trying to import it anyway. I'd suggest installing it with pip install langgraph-checkpoint-sqlite and trying again

@nfcampos commented on GitHub (Sep 24, 2024): Your dependency list suggests you don't have `langgraph-checkpoint-sqlite` installed but are trying to import it anyway. I'd suggest installing it with `pip install langgraph-checkpoint-sqlite` and trying again
Author
Owner

@openSourcerer9000 commented on GitHub (Sep 24, 2024):

mm didn't realize it was unable to install.

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
langchain 0.2.12 requires langchain-core<0.3.0,>=0.2.27, but you have langchain-core 0.3.5 which is incompatible.
langchain-community 0.2.11 requires langchain-core<0.3.0,>=0.2.27, but you have langchain-core 0.3.5 which is incompatible.
langchain-ollama 0.1.1 requires langchain-core<0.3.0,>=0.2.20, but you have langchain-core 0.3.5 which is incompatible.
langchain-openai 0.1.22 requires langchain-core<0.3.0,>=0.2.33, but you have langchain-core 0.3.5 which is incompatible.
langchain-text-splitters 0.2.2 requires langchain-core<0.3.0,>=0.2.10, but you have langchain-core 0.3.5 which is incompatible.
langgraph 0.2.3 requires langchain-core<0.3,>=0.2.27, but you have langchain-core 0.3.5 which is incompatible.
langserve 0.2.2 requires langchain-core<0.3,>=0.1, but you have langchain-core 0.3.5 which is incompatible.

I understand the langchain,langgraph, langsmith ecosystem, but it seems langchain alone being split up into 50 separate libs causes a lot of issues.

It seems it's not on conda either. what's the latest working combination of all this stuff?

@openSourcerer9000 commented on GitHub (Sep 24, 2024): mm didn't realize it was unable to install. ``` ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. langchain 0.2.12 requires langchain-core<0.3.0,>=0.2.27, but you have langchain-core 0.3.5 which is incompatible. langchain-community 0.2.11 requires langchain-core<0.3.0,>=0.2.27, but you have langchain-core 0.3.5 which is incompatible. langchain-ollama 0.1.1 requires langchain-core<0.3.0,>=0.2.20, but you have langchain-core 0.3.5 which is incompatible. langchain-openai 0.1.22 requires langchain-core<0.3.0,>=0.2.33, but you have langchain-core 0.3.5 which is incompatible. langchain-text-splitters 0.2.2 requires langchain-core<0.3.0,>=0.2.10, but you have langchain-core 0.3.5 which is incompatible. langgraph 0.2.3 requires langchain-core<0.3,>=0.2.27, but you have langchain-core 0.3.5 which is incompatible. langserve 0.2.2 requires langchain-core<0.3,>=0.1, but you have langchain-core 0.3.5 which is incompatible. ``` I understand the langchain,langgraph, langsmith ecosystem, but it seems langchain alone being split up into 50 separate libs causes a lot of issues. It seems it's not on conda either. what's the latest working combination of all this stuff?
Author
Owner

@hinthornw commented on GitHub (Sep 25, 2024):

Langchain 0.3.0 is on conda: https://anaconda.org/conda-forge/langchain

@hinthornw commented on GitHub (Sep 25, 2024): Langchain 0.3.0 is on conda: https://anaconda.org/conda-forge/langchain
Author
Owner

@openSourcerer9000 commented on GitHub (Sep 25, 2024):

I was just referring to langgraph-checkpoint-sqlite which is not, and no one seems to know the last time all these packages used to work together.

@openSourcerer9000 commented on GitHub (Sep 25, 2024): I was just referring to langgraph-checkpoint-sqlite which is not, and no one seems to know the last time all these packages used to work together.
Author
Owner

@openSourcerer9000 commented on GitHub (Sep 25, 2024):

My env got nuked uninstalling and reinstalling these packages; I eventually had to reinstall the 15 GB's of stuff in my env to get to get it working again. Besides this deprecation warning, the following versions seem to work. I would recommend following best practices for packaging ecosystems, or simply having a single langchain lib rather than all these separate packages.

LangChainDeprecationWarning: As of langchain-core 0.3.0, LangChain uses pydantic v2 internally. The langchain_core.pydantic_v1 module was a compatibility shim 
for pydantic v1, and should no longer be used. Please update the code to import from Pydantic directly. 

For example, replace imports like: `from langchain_core.pydantic_v1 import BaseModel`
with: `from pydantic import BaseModel`
or the v1 compatibility namespace if you are working in a code base that has not been fully upgraded to 
pydantic 2 yet.         from pydantic.v1 import BaseModel
System Information
------------------
> OS:  Windows
> OS Version:  10.0.19045
> Python Version:  3.12.6 | packaged by conda-forge | (main, Sep 22 2024, 14:01:26) [MSC v.1941 64 bit (AMD64)]

Package Information
-------------------
> langchain_core: 0.3.6
> langchain: 0.3.1
> langchain_community: 0.3.1
> langsmith: 0.1.128
> langchain_ollama: 0.2.0
> langchain_openai: 0.2.0
> langchain_text_splitters: 0.3.0
> langgraph: 0.2.28

Optional packages not installed
-------------------------------
> langserve

Other Dependencies
------------------
> aiohttp: 3.10.6
> async-timeout: Installed. No version info available.
> dataclasses-json: 0.6.7
> httpx: 0.27.2
> jsonpatch: 1.33
> langgraph-checkpoint: 1.0.11
> numpy: 1.26.4
> ollama: 0.3.3
> openai: 1.48.0
> orjson: 3.10.7
> packaging: 24.1
> pydantic: 2.8.2
> pydantic-settings: 2.5.2
> PyYAML: 6.0.2
> requests: 2.32.3
> SQLAlchemy: 2.0.35
> tenacity: 8.5.0
> tiktoken: 0.7.0
> typing-extensions: 4.12.2

@openSourcerer9000 commented on GitHub (Sep 25, 2024): My env got nuked uninstalling and reinstalling these packages; I eventually had to reinstall the 15 GB's of stuff in my env to get to get it working again. Besides this deprecation warning, the following versions seem to work. I would recommend following best practices for packaging ecosystems, or simply having a single langchain lib rather than all these separate packages. ``` LangChainDeprecationWarning: As of langchain-core 0.3.0, LangChain uses pydantic v2 internally. The langchain_core.pydantic_v1 module was a compatibility shim for pydantic v1, and should no longer be used. Please update the code to import from Pydantic directly. For example, replace imports like: `from langchain_core.pydantic_v1 import BaseModel` with: `from pydantic import BaseModel` or the v1 compatibility namespace if you are working in a code base that has not been fully upgraded to pydantic 2 yet. from pydantic.v1 import BaseModel ``` ``` System Information ------------------ > OS: Windows > OS Version: 10.0.19045 > Python Version: 3.12.6 | packaged by conda-forge | (main, Sep 22 2024, 14:01:26) [MSC v.1941 64 bit (AMD64)] Package Information ------------------- > langchain_core: 0.3.6 > langchain: 0.3.1 > langchain_community: 0.3.1 > langsmith: 0.1.128 > langchain_ollama: 0.2.0 > langchain_openai: 0.2.0 > langchain_text_splitters: 0.3.0 > langgraph: 0.2.28 Optional packages not installed ------------------------------- > langserve Other Dependencies ------------------ > aiohttp: 3.10.6 > async-timeout: Installed. No version info available. > dataclasses-json: 0.6.7 > httpx: 0.27.2 > jsonpatch: 1.33 > langgraph-checkpoint: 1.0.11 > numpy: 1.26.4 > ollama: 0.3.3 > openai: 1.48.0 > orjson: 3.10.7 > packaging: 24.1 > pydantic: 2.8.2 > pydantic-settings: 2.5.2 > PyYAML: 6.0.2 > requests: 2.32.3 > SQLAlchemy: 2.0.35 > tenacity: 8.5.0 > tiktoken: 0.7.0 > typing-extensions: 4.12.2 ```
Author
Owner

@vbarda commented on GitHub (Oct 4, 2024):

Closing since the original issue seems to be addressed. I would recommend upgrading to the latest versions of all libraries and using pip if possible. If you run into any additional issues, feel free to open a new issue.

@vbarda commented on GitHub (Oct 4, 2024): Closing since the original issue seems to be addressed. I would recommend upgrading to the latest versions of all libraries and using pip if possible. If you run into any additional issues, feel free to open a new issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraph#244