Your system has an unsupported version of sqlite3. Chroma requires sqlite3 >= 3.35.0

I'm running a flask api to talk to my pdf at the code level, but it's giving me this error:

The imports I use are:

from flask import Flask, request, jsonify, make_response, send_file
import os
import base64
from time import sleep
import shutil
from werkzeug.utils import secure_filename
from langchain.document_loaders import PyMuPDFLoader, TextLoader
from langchain.text_splitter import RecursiveCharacterTextSplitter
from langchain.vectorstores import Chroma
from langchain.embeddings import OpenAIEmbeddings
from langchain.chat_models import ChatOpenAI
from langchain.chains import RetrievalQA


Exception on /process [POST]
Traceback (most recent call last):
  File "/home/payconautomacoes/.local/lib/python3.10/site-packages/flask/", line 2190, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/payconautomacoes/.local/lib/python3.10/site-packages/flask/", line 1486, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/payconautomacoes/.local/lib/python3.10/site-packages/flask/", line 1484, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/payconautomacoes/.local/lib/python3.10/site-packages/flask/", line 1469, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(view_args)
  File "/home/payconautomacoes/mysite/", line 72, in process
    vectordb = Chroma.from_documents(documents=texts, embedding=embeddings, persist_directory=persist_directory)
  File "/home/payconautomacoes/.local/lib/python3.10/site-packages/langchain/vectorstores/", line 592, in from_documents
    return cls.from_texts(
  File "/home/payconautomacoes/.local/lib/python3.10/site-packages/langchain/vectorstores/", line 547, in from_texts
    chroma_collection = cls(
  File "/home/payconautomacoes/.local/lib/python3.10/site-packages/langchain/vectorstores/", line 81, in __init__
    import chromadb
  File "/home/payconautomacoes/.local/lib/python3.10/site-packages/chromadb/", line 36, in <module>
    raise RuntimeError(
RuntimeError: #033[91m***Your system has an unsupported version of sqlite3. Chroma requires sqlite3 >= 3.35.0***.#033[0m
033[94mPlease visit to learn how to upgrade.#033[0m

I solve the problem following the following tutorial already shown in the error. my lack of attention

Glad to hear you got that working!

Hi @payconautomacoes How did you do that in pythonanywhere?

this might be from a recent upgrade of Langchain it was working here before, but not anymore, I note that there are some options in the webpage, but Is not quite clear for me as a hobbyist

I think you're right; our most recent system image has SQLite version 3.31, so if you're getting an error from Langchain saying that it needs a more recent version, but it did work before, then it's likely that Langchain have made a new release that's causing the problem.

I've done a bit of digging around on Google, and if the error you're getting relates to Chroma, it might help if you try running

 pip install pysqlite3-binary

Could you let us know if that helps?

it does work, this solves the issue, thanks so much

the problem is that previous database files using previous versions of Chroma don't work anymore

For software that relies on a backend database, there is usually a way to upgrade databases from old versions. Check the Chroma documentation to see if there is a way to upgrade the database.

No this does not solve the issue

Then perhaps the old database is just not useable.

any updates on this?

Not from our side

Hey im running in the same error but the command pip install pysqlite3-binary does not work, even if i paste the following in my projects init file: import pysqlite3 as sqlite3

How the command pip install pysqlite3-binary fails for you?