langgraph-prebuilt @ 0.5.2 -- Type error: MRO for bases ABC, Generic #840

Closed
opened 2026-02-20 17:42:00 -05:00 by yindo · 10 comments
Owner

Originally created by @sarahec on GitHub (Jul 24, 2025).

Checked other resources

  • This is a bug, not a usage question. For questions, please use the LangChain Forum (https://forum.langchain.com/).
  • I added a clear and detailed title that summarizes the issue.
  • I read what a minimal reproducible example is (https://stackoverflow.com/help/minimal-reproducible-example).
  • I included a self-contained, minimal example that demonstrates the issue INCLUDING all the relevant imports. The code run AS IS to reproduce the issue.

Example Code

Building `python3Packages.langgraph-prebuilt` @ 0.5.2 for nixpkgs

Error Message and Stack Trace (if applicable)

ImportError while loading conftest '/build/source/libs/prebuilt/tests/conftest.py'.
tests/conftest.py:9: in <module>
    from tests.conftest_checkpointer import (
tests/conftest_checkpointer.py:13: in <module>
    from tests.memory_assert import MemorySaverAssertImmutable
tests/memory_assert.py:18: in <module>
    from langgraph.pregel.checkpoint import copy_checkpoint
/nix/store/sphvvrxc9ia2c0scrihy4fjbnh935zjr-source/libs/langgraph/langgraph/pregel/__init__.py:71: in <module>
    from langgraph.pregel.algo import (
/nix/store/sphvvrxc9ia2c0scrihy4fjbnh935zjr-source/libs/langgraph/langgraph/pregel/algo.py:73: in <module>
    from langgraph.pregel.read import INPUT_CACHE_KEY_TYPE, PregelNode
/nix/store/sphvvrxc9ia2c0scrihy4fjbnh935zjr-source/libs/langgraph/langgraph/pregel/read.py:14: in <module>
    from langgraph.pregel.protocol import PregelProtocol
/nix/store/sphvvrxc9ia2c0scrihy4fjbnh935zjr-source/libs/langgraph/langgraph/pregel/protocol.py:16: in <module>
    class PregelProtocol(Runnable[InputT, Any], Generic[StateT, InputT, OutputT], ABC):
E   TypeError: Cannot create a consistent method resolution order (MRO) for bases ABC, Generic

Description

/build/source/libs/prebuilt/tests/conftest.py is experiencing a compilation error under python 3.12.

System Info

See https://github.com/NixOS/nixpkgs/pull/427212 for versions.

Originally created by @sarahec on GitHub (Jul 24, 2025). ### Checked other resources - [x] This is a bug, not a usage question. For questions, please use the LangChain Forum (https://forum.langchain.com/). - [x] I added a clear and detailed title that summarizes the issue. - [x] I read what a minimal reproducible example is (https://stackoverflow.com/help/minimal-reproducible-example). - [x] I included a self-contained, minimal example that demonstrates the issue INCLUDING all the relevant imports. The code run AS IS to reproduce the issue. ### Example Code ```python Building `python3Packages.langgraph-prebuilt` @ 0.5.2 for nixpkgs ``` ### Error Message and Stack Trace (if applicable) ```shell ImportError while loading conftest '/build/source/libs/prebuilt/tests/conftest.py'. tests/conftest.py:9: in <module> from tests.conftest_checkpointer import ( tests/conftest_checkpointer.py:13: in <module> from tests.memory_assert import MemorySaverAssertImmutable tests/memory_assert.py:18: in <module> from langgraph.pregel.checkpoint import copy_checkpoint /nix/store/sphvvrxc9ia2c0scrihy4fjbnh935zjr-source/libs/langgraph/langgraph/pregel/__init__.py:71: in <module> from langgraph.pregel.algo import ( /nix/store/sphvvrxc9ia2c0scrihy4fjbnh935zjr-source/libs/langgraph/langgraph/pregel/algo.py:73: in <module> from langgraph.pregel.read import INPUT_CACHE_KEY_TYPE, PregelNode /nix/store/sphvvrxc9ia2c0scrihy4fjbnh935zjr-source/libs/langgraph/langgraph/pregel/read.py:14: in <module> from langgraph.pregel.protocol import PregelProtocol /nix/store/sphvvrxc9ia2c0scrihy4fjbnh935zjr-source/libs/langgraph/langgraph/pregel/protocol.py:16: in <module> class PregelProtocol(Runnable[InputT, Any], Generic[StateT, InputT, OutputT], ABC): E TypeError: Cannot create a consistent method resolution order (MRO) for bases ABC, Generic ``` ### Description `/build/source/libs/prebuilt/tests/conftest.py` is experiencing a compilation error under python 3.12. ### System Info See https://github.com/NixOS/nixpkgs/pull/427212 for versions.
yindo added the bugpending labels 2026-02-20 17:42:00 -05:00
yindo closed this issue 2026-02-20 17:42:00 -05:00
Author
Owner

@sydney-runkle commented on GitHub (Jul 24, 2025):

Should be fixed if you upgrade to the latest langgraph version!

@sydney-runkle commented on GitHub (Jul 24, 2025): Should be fixed if you upgrade to the latest langgraph version!
Author
Owner

@sarahec commented on GitHub (Jul 26, 2025):

Should be fixed if you upgrade to the latest langgraph version!

Is that 6.00 alpha 2? I need to wait for a stable release before pushing a PR to nixpkgs.

@sarahec commented on GitHub (Jul 26, 2025): > Should be fixed if you upgrade to the latest langgraph version! Is that 6.00 alpha 2? I need to wait for a stable release before pushing a PR to nixpkgs.
Author
Owner

@sydney-runkle commented on GitHub (Jul 27, 2025):

Fixed in v0.5.4, latest stable

@sydney-runkle commented on GitHub (Jul 27, 2025): Fixed in v0.5.4, latest stable
Author
Owner

@sarahec commented on GitHub (Jul 27, 2025):

Fixed in v0.5.4, latest stable

Sorry, I'm confused. There's no release of langgraph-prebuilt-0.5.4. There's langgraph 0.5.4, which, as far as I know, depends on langgraph-prebuilt. (We build off releases; are you saying we should check out the monorepo at commit 1ee6bfe and build -prebuilt from there? Alternately, is there a patch I can pull in?)

@sarahec commented on GitHub (Jul 27, 2025): > Fixed in v0.5.4, latest stable Sorry, I'm confused. There's no release of langgraph-prebuilt-0.5.4. There's langgraph 0.5.4, which, as far as I know, depends on langgraph-prebuilt. (We build off releases; are you saying we should check out the monorepo at commit 1ee6bfe and build -prebuilt from there? Alternately, is there a patch I can pull in?)
Author
Owner

@sydney-runkle commented on GitHub (Jul 27, 2025):

Ah sorry, didn't see full context here.

Why are you compiling prebuilt/tests/conftest.py? langgraph-prebuilt comes as a part of langgraph and doesn't work independent of it...

@sydney-runkle commented on GitHub (Jul 27, 2025): Ah sorry, didn't see full context here. Why are you compiling `prebuilt/tests/conftest.py`? `langgraph-prebuilt` comes as a part of `langgraph` and doesn't work independent of it...
Author
Owner

@sarahec commented on GitHub (Jul 27, 2025):

Ah sorry, didn't see full context here.

Why are you compiling prebuilt/tests/conftest.py? langgraph-prebuilt comes as a part of langgraph and doesn't work independent of it...

Since -prebuilt has its own releases, we build it as its own package. (It was originally described as being developed by its own team on an independent release cycle from langgraph.)

P.S. I didn't see the conflict until recently as I was dealing with a few huge projects.

@sarahec commented on GitHub (Jul 27, 2025): > Ah sorry, didn't see full context here. > > Why are you compiling `prebuilt/tests/conftest.py`? `langgraph-prebuilt` comes as a part of `langgraph` and doesn't work independent of it... Since -prebuilt has its own releases, we build it as its own package. (It was originally described as being developed by its own team on an independent release cycle from langgraph.) P.S. I didn't see the conflict until recently as I was dealing with a few huge projects.
Author
Owner

@sarahec commented on GitHub (Jul 27, 2025):

Also, sorry, the full test path is libs/prebuilt/tests/conftest.py. We follow the settings in pyproject.toml when configuring pytest and that doesn't exclude this file.

@sarahec commented on GitHub (Jul 27, 2025): Also, sorry, the full test path is `libs/prebuilt/tests/conftest.py`. We follow the settings in [pyproject.toml](https://github.com/langchain-ai/langgraph/blob/main/libs/prebuilt/pyproject.toml) when configuring `pytest` and that doesn't exclude this file.
Author
Owner

@sydney-runkle commented on GitHub (Jul 28, 2025):

Are you working on langgraph or langgraph-prebuilt? Shouldn't need the test files otherwise...

@sydney-runkle commented on GitHub (Jul 28, 2025): Are you working on `langgraph` or `langgraph-prebuilt`? Shouldn't need the test files otherwise...
Author
Owner

@sarahec commented on GitHub (Jul 28, 2025):

I'm packaging langgraph-prebuilt just as we package langgraph. Our standard is to:

  1. Build from the Github release whenever possible (as building from pypi opens the door to a supply-chain attack)
  2. If there are tests, we run them. It helps us ensure the package runs with the dependencies we have (especially when a dependency version updates). We often catch bugs that the developer missed.

If you have a couple of minutes, https://nixos.org/guides/how-nix-works/ explains why we build and test packages individually.

@sarahec commented on GitHub (Jul 28, 2025): I'm packaging `langgraph-prebuilt` just as we package `langgraph`. Our standard is to: 1. Build from the Github release whenever possible (as building from pypi opens the door to a supply-chain attack) 2. If there are tests, we run them. It helps us ensure the package runs with the dependencies we have (especially when a dependency version updates). We often catch bugs that the developer missed. If you have a couple of minutes, https://nixos.org/guides/how-nix-works/ explains why we build and test packages individually.
Author
Owner

@sydney-runkle commented on GitHub (Jul 28, 2025):

Ah ok. Should be fixed for langgraph v0.6.0 and the same for prebuilt

@sydney-runkle commented on GitHub (Jul 28, 2025): Ah ok. Should be fixed for `langgraph` v0.6.0 and the same for prebuilt
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraph#840