Below is the exact error : copy pasted from the log
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 "/home/adminuser/venv/lib/python3.12/site-packages/streamlit/runtime/scriptrunner/exec_code.py", line 88, in exec_func_with_error_handling
result = func()
^^^^^^File "/home/adminuser/venv/lib/python3.12/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 579, in code_to_exec
exec(code, module.__dict__)File "/mount/src/chattie/app.py", line 3, in <module>
from chattie_chat import chat_with_chattie, extract_text_from_pdfFile "/mount/src/chattie/chattie_chat.py", line 1, in <module>
from openai import OpenAI
I can’t see your repo, because it’s apparently private, but it looks like you need to add a requirements.txt file to tell streamlit cloud what packages to install (in this case openai) – see App dependencies for your Community Cloud app - Streamlit Docs for more details.
hi, I do have a requirements.txt file. Copy pasting the contents below. I am keeping my repository private because literally 2 mins back, I made it public and my API key was disabled by OpenAI!
from openai import OpenAI, seems to work absolutely fine when running it locally. but while deploying on cloud, its causing an issue. what’s the right command?
hi @blackary - i have made the repo public. Is there anyway you could check and give inputs on what needs to change for the deployment to work?
I really want this app to work
@Goyo - thx. that worked. but now I am stuck with the openai API key. When I was running the code locally, i used something called “client” to set the api key in, and then called client_instance to make the responses work. Now making edits to the code , to make it run on cloud- is a bit confusing. any suggestions there please? In advanced settings, I added the openai API key. and now how do i use it using st.secrets in the code?
Hey @sudeeptasahu29 you can access your secrets in the following way
In the streamlit app settings save your key like this
[“open_ai_key”]
key = “your_api_key”