I’ve got my app working perfectly on my local machine, but when trying to host it on the cloud here on streamlit I’m getting: ModuleNotFoundError: No module named ‘openai.api_resources’
I get this error after selecting a few things that end up with a vector store being read.
I absolutely have openai included in my requirements.txt
This seems to be my one last hurdle before my app can go live and I’d appreciate your help!!
File “/home/adminuser/venv/lib/python3.11/site-packages/streamlit/runtime/scriptrunner/script_runner.py”, line 565, in _run_script
exec(code, module.dict)
File “/mount/src/guideline_gopher/app.py”, line 158, in
main()
File “/mount/src/guideline_gopher/app.py”, line 113, in main
guideline_gopher(store_name)
File “/mount/src/guideline_gopher/app.py”, line 49, in guideline_gopher
VectorStore = pickle.load(f)
^^^^^^^^^^^^^^
ModuleNotFoundError: No module named ‘openai.api_resources’
As mentioned in the pypi page, the API has recently changed and your old code won’t work in recent versions without changes.
Installation
[!IMPORTANT] The SDK was rewritten in v1, which was released November 6th 2023. See the v1 migration guide, which includes scripts to automatically update your code.
Hi Goyo,
Thanks for the insight. I read through what you sent, but I am however at a loss as to why my code works just fine locally but fails when I try to run from streamlit cloud.
Locally I’m running it with Anaconda. Is it possible that Anaconda is running with the dependencies that I initialized it with like 3 weeks ago so the new openai updates are irrelevant?
If I knew the reason for why it’s running locally and not on the cloud surely I could fix the problem.
(I’m new to coding BTW)
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.