Unsupported version of sqlite3

I have deployed my app for the first time to the Community Cloud. When I try to run it I get the following error:

“Your system has an unsupported version of sqlite3. Chroma requires sqlite3 >= 3.35.0. Please visit 🔍 Troubleshooting | Chroma Docs to learn how to upgrade.”

This is my app: https://storycrew.streamlit.app/

One of the options was to install the latest version of Python. How can I do that if the app is hosted here? I am fairly new to Python development so any help is appreciated.

Hey @Nick3, I am not sure whether you can do that for an already deployed app. One option should be to delete the app and re-deploy and set the Python version in the Creation dialog when clicking on Advanced settings:

For deploying to streamlit cloud, do as the bullet point starting with “If you are on a Linux system…” says.

Thanks for the suggestion. I deleted my app and added it again but the Python version is still the same one I specified before. Unfortunately it didn’t work.

@Goyo Thank you for your suggestion. I tried the suggestion but I am developing on a Windows computer and the install of sqlite3-binary failed with errors about not being able to find the file in my Visual Studio directory.

In Windows just use a recent version of python. Anything >= 3.11 should do. Do not try to install sqlite3-binary there.

1 Like

Hi

i have an error message and i cannot figure out the solution. can anyone help to advise?

The solution is in the error message: visit :mag: Troubleshooting | Chroma Docs to learn how to upgrade.

Hi
i have installed sqlite3 but i still have the error message.

sqlite3 --version
3.46.1 2024-08-13 09:16:08 c9c2ab54ba1f5f46360f1b4f35d849cd3f080e6fc2b6c60e91b16c63f69a1e33 (64-bit)

If you want your application to work in streamlit cloud, you need to fix the issue in your streamlit cloud environment, not in your own computer.

Things that finally worked for me after spending 2 nights on it:

Step 1: Modify your requirements.txt file by adding pysqlite3-binary. This adjustment ensures your application operates with the necessary version. Just include this line in your requirements.txt:

pysqlite3-binary

Step 2 (Optional): if you are using sqlite3 directly somewhere then update your code. Replace:

import sqlite3

with:

import pysqlite3 as sqlite3

Step 3: If the error is being caused due to a dependency of any class on sqlite3 then make sure to add the below lines above the lines causing error. As a matter of fact, it is simply better to add it at the top of the python file where there error is being caused:

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

Step 4: Delete the current app and redeploy it. Also, while deploying it go to
Advance Seetings>Python Version to 3.11.

Hope it solves this issue. Enjoy your app streamlit cloud.

Fun Fact: I tackled this error while trying to deploy my Ai Writing Agent Crew on streamlit and hence it is super satisfying to generate this comment with my writing agent crew running on streamlit cloud. Cheers to all the dev out there !!!