[Python] streamlit: Your system has an unsupported version of sqlite3. Chroma requires sqlite3...

Discussão em 'Python' iniciado por Stack, Dezembro 9, 2024.

  1. Stack

    Stack Membro Participativo

    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.

    [​IMG]

    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?

    Continue reading...

Compartilhe esta Página