Chromadb, sqlite3, Your system has an unsupported version of sqlite3

My app is running locally and now I try to deploy it since yesterday.
I can’t share the app because it is not intended for the public.

I get changing errors for chromadb and sqlite3.

RuntimeError: �[91mYour system has an unsupported version of sqlite3. Chroma requires sqlite3 >= 3.35.0.�[0m�[94mPlease visit https://docs.trychroma.com/troubleshooting#sqlite to learn how to upgrade.�[0m

After I fix that one, I get another, and then another.

I tried the solutions here on the forum, especially:

import pysqlite3
import sys
sys.modules["sqlite3"] = sys.modules.pop("pysqlite3")
import sqlite3

import os
import pandas as pd
from typing import List
from pydantic import BaseModel, Field
import tiktoken
import streamlit as st
from sqlalchemy import create_engine
from langchain.schema import Document, HumanMessage, AIMessage
from langchain.text_splitter import RecursiveCharacterTextSplitter
from langchain_chroma import Chroma
from langchain_openai import ChatOpenAI
from langchain_openai import OpenAIEmbeddings
from langchain.output_parsers import PydanticOutputParser

adding the above three lines over my import.

I went to deploying my app with no requirements.txt file, and just installing the packages online.
I changed python version from 3.12 to 3.11 and back.

Now I like to ask the following question:
How do I get this to run, what is a proven way to not run into sqlite3 errors?
I would rewrite my code and everything.

What error are you getting with that code?

In Python 3.12. this code:

import pandas as pd
import tiktoken
import streamlit as st
from typing import List
from pydantic import BaseModel, Field
from sqlalchemy import create_engine

# LangChain imports
from langchain.schema import Document, HumanMessage, AIMessage
from langchain.text_splitter import RecursiveCharacterTextSplitter
from langchain.output_parsers import PydanticOutputParser
from langchain_chroma import Chroma
from langchain_openai import ChatOpenAI
from langchain_openai import OpenAIEmbeddings

after carefully installing with pip remotely I get

RuntimeError: e[91mYour system has an unsupported version of sqlite3. Chroma requires sqlite3 >= 3.35.0.e[0m e[94mPlease visit https://docs.trychroma.com/troubleshooting#sqlite to learn how to upgrade.e[0m

after adding

import pysqlite3
import sys
sys.modules["sqlite3"] = sys.modules.pop("pysqlite3")
import sqlite3

I still get

RuntimeError: e[91mYour system has an unsupported version of sqlite3. Chroma requires sqlite3 >= 3.35.0.e[0m e[94mPlease visit https://docs.trychroma.com/troubleshooting#sqlite to learn how to upgrade.e[0m

Now I can’t install pysqlite3-binary:

Running setup.py clean for pysqlite-binary
Failed to build pysqlite-binary
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (pysqlite-binary)

I have the same problem as described here:

python -c "import sqlite3; print(sqlite3.version)"
2.6.0

I build this now too:

python -c "import pysqlite3; print(pysqlite3.version)"
2.6.0

also adding this

sqlite3.version = "3.35.0"
sqlite3.sqlite_version = "3.35.0"
sqlite3.sqlite_version_info = (3, 35, 0)

But then it only fails later.

How do I install a chroma version that is compatible with sqlite 2.6.0?

This is confusing. I was thinking you were deploying to streamlit cloud, but it seems I was wrong. It is hard to tell what is going in because you are omitting almost all the relevant information from the tracebacks. And your description of the issue is inconsistent, like you saying “I can’t install pysqlite3-binary” and then showing an error related to pysqlite-binary, which is a different pypi package.

You need to provide details about your deployment environment, complete tracebacks and a clear explanation of what you are doing.

Ok Thank you.
I have the same problem a lot of other people complain about. I like to port my working app into the streamlit cloud.

I said I can’t install it, because I couldn’t, I had to build it from source. I did not change anything.

This should work for streamlit cloud, even for python 3.12 (you can skip the second part of step 4):

Do not try to install pysqlite3, pysqlite, psqlite-binary, etc. Just pysqlite3-binary. Do not try this in a Windows system, it won’t work there and you don’t need it anyway.

Thank you!

I am writing a RAG app that is for research purposes on a rare disease, by helping me you made this possible, thank you again!

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.