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”
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.