I previously deployed an app on Streamlit Cloud that utilized chromadb
.
The app worked fine in the past. However, today I encountered a new error (as indicated in the title) and the app has stopped functioning.
I attempted to troubleshoot based on solutions from the Streamlit forum and performed the following steps sequentially:
requirements.txt
file by adding pysqlite3-binary
.app.py
:__import__('pysqlite3')
import sys
sys.modules['sqlite3'] = sys.modules.pop('pysqlite3')
After rebooting my app, I discovered the new error:
ModuleNotFoundError: No module named 'pysqlite3'
Traceback:
File "/home/adminuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 552, in _run_script
exec(code, module.__dict__)
File "/mount/src/docgpt-streamlit/app.py", line 2, in <module>
import pysqlite3
Subsequently, I tried adding pysqlite3
again to requirements.txt
, but the error persisted.
According to the logs from manage app, I observed that Streamlit did not perform a re-pip install action.
Could this be causing the pysqlite error? If so, how can I correctly enable the Streamlit app to automatically pip install due to my updated requirements.txt
?
I did this and it worked for me:
pysqlite3-binary
using: pip3 install pysqlite3-binary
Chromadb
Credits: I got this answer from here: Issues with chroma and sqlite
Note: Doesn't matter if you are using django
, flask
or fastapi
. It should work regardless.
__import__('pysqlite3')
import sys
sys.modules['sqlite3'] = sys.modules.pop('pysqlite3')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With