Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

react-agent-python template does not work #3100

Closed
4 tasks done
viren-vii opened this issue Jan 19, 2025 · 2 comments
Closed
4 tasks done

react-agent-python template does not work #3100

viren-vii opened this issue Jan 19, 2025 · 2 comments
Labels
question Further information is requested

Comments

@viren-vii
Copy link
Contributor

Checked other resources

  • This is a bug, not a usage question. For questions, please use GitHub Discussions.
  • 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

langgraph new path/to/your/app --template react-agent-python

Error Message and Stack Trace (if applicable)

File "C:\Python311\Lib\site-packages\starlette\routing.py", line 693, in lifespan
    async with self.lifespan_context(app) as maybe_state:
  File "C:\Python311\Lib\contextlib.py", line 204, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\site-packages\langgraph_api\lifespan.py", line 30, in lifespan
    await collect_graphs_from_env(True)
  File "C:\Python311\Lib\site-packages\langgraph_api\graph.py", line 257, in collect_graphs_from_env
    graph = await run_in_executor(None, _graph_from_spec, spec)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\site-packages\langchain_core\runnables\config.py", line 588, in run_in_executor
    return await asyncio.get_running_loop().run_in_executor(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\concurrent\futures\thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\site-packages\langchain_core\runnables\config.py", line 579, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\site-packages\langgraph_api\graph.py", line 295, in _graph_from_spec
    modspec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "D:\projects\forexdropoff\react-agent\./src/react_agent/graph.py", line 14, in <module>
    from react_agent.configuration import Configuration
ModuleNotFoundError: No module named 'react_agent'
Could not import python module for graph:
GraphSpec(id='agent', path='./src/react_agent/graph.py', module=None, variable='graph', config=None)
This error likely means you haven't installed your project and its dependencies yet. Before running the server, install your project:

If you are using requirements.txt:
python -m pip install -r requirements.txt

If you are using pyproject.toml or setuptools:
python -m pip install -e .

Make sure to run this command from your project's root directory (where your setup.py or pyproject.toml is located)
 [uvicorn.error] api_variant=local_dev
2025-01-19T02:33:06.962480Z [error    ] Application startup failed. Exiting. [uvicorn.error] api_variant=local_dev

Description

I am trying to run the template on the local server.
Despite following the docs the same error is triggering. I have tried to fix the packages but have not been able to go around.

System Info

System Information

OS: Windows
OS Version: 10.0.22631
Python Version: 3.11.4 (tags/v3.11.4:d2340ef, Jun 7 2023, 05:45:37) [MSC v.1934 64 bit (AMD64)]

Package Information

langchain_core: 0.3.30
langchain: 0.3.14
langchain_community: 0.3.14
langsmith: 0.2.11
langchain_anthropic: 0.3.3
langchain_fireworks: 0.2.6
langchain_openai: 0.3.0
langchain_text_splitters: 0.3.5
langgraph_sdk: 0.1.51

Optional packages not installed

langserve

Other Dependencies

aiohttp: 3.11.11
anthropic: 0.43.1
async-timeout: Installed. No version info available.
dataclasses-json: 0.6.7
defusedxml: 0.7.1
fireworks-ai: 0.15.11
httpx: 0.28.1
httpx-sse: 0.4.0
jsonpatch: 1.33
langsmith-pyo3: Installed. No version info available.
numpy: 1.26.4
openai: 1.59.8
orjson: 3.10.15
packaging: 24.2
pydantic: 2.10.5
pydantic-settings: 2.7.1
PyYAML: 6.0.2
requests: 2.32.3
requests-toolbelt: 1.0.0
SQLAlchemy: 2.0.37
tenacity: 9.0.0
tiktoken: 0.8.0
typing-extensions: 4.12.2
zstandard: Installed. No version info available.

@vbarda
Copy link
Collaborator

vbarda commented Jan 21, 2025

The traceback you provided shows a recommended solution:

If you are using pyproject.toml or setuptools:
python -m pip install -e .

It means you haven't installed the project dependencies. Let me know if running this command and then running langgraph dev again fixes this for you

@vbarda vbarda added the question Further information is requested label Jan 21, 2025
@vbarda
Copy link
Collaborator

vbarda commented Jan 27, 2025

Closing due to inactivity - the issue should be resolvable by installing the dependencies as in the snippet above

@vbarda vbarda closed this as completed Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants