OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

No module named 'langgraph.prebuilt', 'langgraph' is not a package

  • Thread starter Thread starter PARINAZ TABARI
  • Start date Start date
P

PARINAZ TABARI

Guest
I am trying to work with langgraph. Although I installed all required packages, I still encounter error.

Code:
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)

The error is:

Code:
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)

I installed langgraph and updated PATH.
<p>I am trying to work with <a href="https://python.langchain.com/docs/langgraph" rel="nofollow noreferrer"><strong>langgraph</strong></a>. Although I installed all required packages, I still encounter error.</p>
<pre class="lang-py prettyprint-override"><code>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)

</code></pre>
<p>The error is:</p>
<pre class="lang-none prettyprint-override"><code>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)
</code></pre>
<p>I installed langgraph and updated <code>PATH</code>.</p>
 

Latest posts

Top