Chroma and SQLite issue on Streamlit deployments

Hi - I’m running into an issue that was mentioned before with Chroma and SQLite. TLDR my application runs fine locally, but when hosting on Streamlit I run into an issue where the version of SQLite on my instance is too low for Chroma. I’ve tried deployed with Python versions 3.9 / 3.10 / 3.11 and it didn’t help.

The recommended advice in that old thread and also in the Chroma docs is to run pip install pysqlite3-binary, but that just gives:

ERROR: Could not find a version that satisfies the requirement pysqlite3-binary (from versions: none)
ERROR: No matching distribution found for pysqlite3-binary

Has anyone else run into this / is there an alternative fix?

@kalebima have you found a solution? I’m having the same problem trying llama_index with chromadb

I am having the same issue.

You should try putting pysqlite3-binary in the requirements.txt then try placing the three lines of code again:

__import__('pysqlite3')
import sys

sys.modules['sqlite3'] = sys.modules.pop('pysqlite3')

If need be, try to import sqlite3 as well.

I kind off referred to this stack overflow question if you’re wondering.