3

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:

  1. Updated the requirements.txt file by adding pysqlite3-binary.
  2. Added the following three lines of code at the top of 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.

enter image description here

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?

Xiang
  • 230
  • 2
  • 10

1 Answers1

1

Now I've solved this problem.

The streamlit app will not re-install module even you reboot.

Therefore, I deploy the app:

  1. Delete app.
  2. ReNew app.

Then the module will re-install.

Xiang
  • 230
  • 2
  • 10