streamlit chat application giving error when deployed to community cloud

Please take a moment to search the forum and documentation before posting a new topic.
If you’re creating a debugging post, please include the following info:

  1. I am trying to run the app on streamlit cloud but it gives me error:

    the app works completely fine in local enviornemnt, i m running it under linux(Ubuntu)

  2. https://memory-aware-agentic-ai-cg24yr6aaylqbtnmkc4usl.streamlit.app/ this is the deployed link

  3. https://github.com/pushpitkamboj/memory-Aware-Agentic-AI this is the github repo link, it requires python 3+, OpenAI api keys, (it has a fastapi but that works completely fine, i use SQLModel for ORM and postgreSQL as DB)

  4. ModuleNotFoundError: This app has encountered an error. The original error message is redacted to prevent data leaks. Full error details have been recorded in the logs (if you’re on Streamlit Cloud, click on ‘Manage app’ in the lower right of your app).

    Traceback:

    File "/mount/src/memory-aware-agentic-ai/todo_agent/streamlit.py", line 5, in <module>
        from agent import orchestrator
    
    

    File "/mount/src/memory-aware-agentic-ai/todo_agent/agent.py", line 1, in <module> from agents import Agent, run_demo_loop, function_tool

  5. Python 3.10.12,
    Streamlit, version 1.49.1

  6. Please help, you can even reachout

What is module agents supposed to be? I can’t find it in your code and you are not declaring any dependencies.

its being imported from openAI agents sdk, u can run pip install openai-agents.
i used Runner to run the agent.
Docs : Running agents - OpenAI Agents SDK

dependencies = [
“openai-agents>=0.3.2”,
“pydantic>=2.0.0”,
“httpx>=0.27.0”,
# For REST API
“fastapi>=0.0.12”,
“sqlmodel>=0.0.20”,
]
Requires Python 3.9 or higher

Looks like you are missing those dependencies in your deployment.

thank you for the help,
i have added requirements.txt file in my repo, updated the python version to 3.10 in the settings
Now i am getting this error:

File "/mount/src/memory-aware-agentic-ai/todo_agent/streamlit.py", line 5, in <module>
    from agent import orchestratorFile "/mount/src/memory-aware-agentic-ai/todo_agent/agent.py", line 1, in <module>
    from agents import Agent, run_demo_loop, function_toolFile "/home/adminuser/venv/lib/python3.10/site-packages/agents/__init__.py", line 22, in <module>
    from . import scriptsFile "/home/adminuser/venv/lib/python3.10/site-packages/agents/scripts/__init__.py", line 21, in <module>
    from . import trainFile "/home/adminuser/venv/lib/python3.10/site-packages/agents/scripts/train.py", line 33, in <module>
    from agents.scripts import configsFile "/home/adminuser/venv/lib/python3.10/site-packages/agents/scripts/configs.py", line 26, in <module>
    from agents.scripts import networksFile "/home/adminuser/venv/lib/python3.10/site-packages/agents/scripts/networks.py", line 30, in <module>
    tfd = tf.contrib.distributions

please help

I don’t see any error messages there, but from looking at your requirements.txt I think you installed the wrong package. You said you wanted openai-agents, but you are asking for agents.

thank you so much for helping, it works fine now.
:blush:

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.