我正在尝试与 langgraph 合作。虽然我安装了所有必需的软件包,但我仍然遇到错误。
from langchain_community.tools.tavily_search import TavilySearchResults
from langgraph.prebuilt import ToolExecutor
OPENAI_API_KEY = ...
TAVILY_API_KEY = ...
tools = [TavilySearchResults(max_results=1)]
tool_executor = ToolExecutor (tools)
错误是:
Exception has occurred: ModuleNotFoundError
No module named 'langgraph.prebuilt'; 'langgraph' is not a package
AttributeError: partially initialized module 'langgraph' has no attribute '__path__' (most likely due to a circular import)
我安装了 langgraph 并更新了
PATH
。
我有一个类似的问题,我的文件名被称为“langgraph.py”。
将其更改为另一个文件名解决了我的问题。