(Python3.12.4) TypeError: ForwardRef._evaluate() missing 1 required keyword-only argument: 'recursive_guard' #113

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

Originally created by @gbaian10 on GitHub (Jun 11, 2024).

Checked other resources

  • I added a very descriptive title to this issue.
  • I searched the 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 LangChain rather than my code.

Example Code

from langgraph.graph import StateGraph

Error Message and Stack Trace (if applicable)

TypeError: ForwardRef._evaluate() missing 1 required keyword-only argument: 'recursive_guard'

Description

Looks the same as these issues

langchain #22692
pydantic #9612

Is this a problem caused by pydantic?

If pydantic has not fixed the problem, can it only be back to 3.12.3?

System Info

python_version==3.12.4
langgraph==0.0.66
langchain==0.2.3
pydantic==2.7.3

platform==windows

Originally created by @gbaian10 on GitHub (Jun 11, 2024). ### Checked other resources - [X] I added a very descriptive title to this issue. - [x] I searched the LangChain documentation with the integrated search. - [ ] 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 LangChain rather than my code. ### Example Code ```python from langgraph.graph import StateGraph ``` ### Error Message and Stack Trace (if applicable) TypeError: ForwardRef._evaluate() missing 1 required keyword-only argument: 'recursive_guard' ### Description Looks the same as these issues [langchain #22692](https://github.com/langchain-ai/langchain/issues/22692) [pydantic #9612](https://github.com/pydantic/pydantic/pull/9612) Is this a problem caused by pydantic? If pydantic has not fixed the problem, can it only be back to 3.12.3? ### System Info python_version==3.12.4 langgraph==0.0.66 langchain==0.2.3 pydantic==2.7.3 platform==windows
yindo closed this issue 2026-02-20 17:26:51 -05:00
Author
Owner

@hinthornw commented on GitHub (Jun 12, 2024):

Ya pydantic v1 isn't currently compatible with python 3.12.4

We are taking steps to migrate our packages to pydantic v2 , but since it would be a breaking change for some teams / require a code mods; we have done our best to avoid breaking changes where possible

@hinthornw commented on GitHub (Jun 12, 2024): Ya pydantic v1 isn't currently compatible with python 3.12.4 We are taking steps to migrate our packages to pydantic v2 , but since it would be a breaking change for some teams / require a code mods; we have done our best to avoid breaking changes where possible
Author
Owner

@gbaian10 commented on GitHub (Jun 12, 2024):

Ya pydantic v1 isn't currently compatible with python 3.12.4

We are taking steps to migrate our packages to pydantic v2 , but since it would be a breaking change for some teams / require a code mods; we have done our best to avoid breaking changes where possible

Does this migration plan include the LangChain part? Or only the LangGraph part?

@gbaian10 commented on GitHub (Jun 12, 2024): > Ya pydantic v1 isn't currently compatible with python 3.12.4 > > We are taking steps to migrate our packages to pydantic v2 , but since it would be a breaking change for some teams / require a code mods; we have done our best to avoid breaking changes where possible Does this migration plan include the LangChain part? Or only the LangGraph part?
Author
Owner

@hinthornw commented on GitHub (Jun 12, 2024):

It's LangChain core that would need to change! We'd bump all the dependent packages together

@hinthornw commented on GitHub (Jun 12, 2024): It's LangChain core that would need to change! We'd bump all the dependent packages together
Author
Owner

@gbaian10 commented on GitHub (Jun 13, 2024):

Update pydantic to 2.7.4 will solve the problem.

@gbaian10 commented on GitHub (Jun 13, 2024): Update pydantic to 2.7.4 will solve the problem.
Author
Owner

@namiraprita commented on GitHub (Jun 17, 2024):

Update pydantic to 2.7.4 will solve the problem.

do you mind to share how'd you update the pydantic? that'll be helpful!

@namiraprita commented on GitHub (Jun 17, 2024): > Update pydantic to 2.7.4 will solve the problem. do you mind to share how'd you update the pydantic? that'll be helpful!
Author
Owner

@gbaian10 commented on GitHub (Jun 17, 2024):

Update pydantic to 2.7.4 will solve the problem.

do you mind to share how'd you update the pydantic? that'll be helpful!

If you are using v2, use pip install pydantic -U

If you are still using v1, use pip install pydantic==1.10.16

@gbaian10 commented on GitHub (Jun 17, 2024): > > Update pydantic to 2.7.4 will solve the problem. > > do you mind to share how'd you update the pydantic? that'll be helpful! If you are using v2, use `pip install pydantic -U` If you are still using v1, use `pip install pydantic==1.10.16`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraph#113