crewAI icon indicating copy to clipboard operation
crewAI copied to clipboard

Your system has an unsupported version of sqlite3.

Open KGKallasmaa opened this issue 1 year ago • 10 comments

Hey, I was trying to create a simple crew ai + fastapi application, and I ran into this issue.

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

Versions: [tool.poetry.dependencies] python = ">=3.10,<3.13" uvicorn = "^0.30.3" crewai = "^0.41.1" fastapi = "^0.111.1"

KGKallasmaa avatar Jul 23 '24 09:07 KGKallasmaa

Hi @KGKallasmaa What OS are you using?

Are you running your crew in a clean Virtual env?

theCyberTech avatar Jul 24 '24 02:07 theCyberTech

@KGKallasmaa

Had a same issue when running other app on public cloud. This issue is due to your os system setup and/or python version, and chromadb requirements.

You can try following:

  1. add/ install: pysqlite3-binary ~= 0.5.2 to your requirements 2 . add to the top of the main file: import sqlite3 import pysqlite3 import sys sys.modules['sqlite3'] = sys.modules.pop('pysqlite3')

this should hot swap incompatible version of sqlite3

if it doesn't work, try upgrading your python version. (with steps above) On a public cloud which I have used or embedchain app it started to work with python 3.12
Let me know if you have succeeded.

goran-ristic-dev avatar Jul 25 '24 12:07 goran-ristic-dev

I am experiencing this on the streamlit.io deployment of my CrewAI (v0.36.1) app since they install http://deb.debian.org/debian bullseye/main amd64 sqlite3 amd64 3.34.1-3. I am running Python 3.12... and it doesn't seem to matter what version of Python I choose in the cloud configuration.

I am running Python 3.12.4 for local development. Everything works in development. My local sqlite3 version is 3.43.2 though.

[tool.poetry.dependencies] python = ">=3.10,<=3.13" crewai = "^0.36.1" streamlit = "^1.35.0" python-dotenv = "^1.0.1" docx2txt = "^0.8" exa-py = "^1.0.12" crewai-tools = "^0.4.0" langchain-openai = "^0.1.7" python-docx = "^1.1.2" markdown2 = "^2.4.13" pypandoc = "^1.13" markdown2docx = "^0.1.0" pydantic = "^2.8.2"

  • I wasn't able to install pysqlite3-binary (0.5.3.post1). It would just fail.

(.venv) (.venv) % poetry add pysqlite3-binary Using version ^0.5.3.post1 for pysqlite3-binary

Updating dependencies Resolving dependencies... (7.6s)

Package operations: 1 install, 0 updates, 0 removals

  • Installing pysqlite3-binary (0.5.3.post1): Failed

RuntimeError

Unable to find installation candidates for pysqlite3-binary (0.5.3.post1)

at .venv/lib/python3.12/site-packages/poetry/installation/chooser.py:74 in choose_for 70│ 71│ links.append(link) 72│ 73│ if not links: → 74│ raise RuntimeError(f"Unable to find installation candidates for {package}") 75│ 76│ # Get the best link 77│ chosen = max(links, key=lambda link: self._sort_key(package, link)) 78│

Cannot install pysqlite3-binary.

  • My assumption is that you only want to install the binary if running an older [than 3.12] Python.
  • I started to try and pin to chromadb 0.3.29 and downgrade libraries but that got messy fast.
  • I was able to spin up chroma in a docker container and use it directly, but I don't know how to update crewai to use a remote chromadb.

hiddenkirby avatar Sep 13 '24 21:09 hiddenkirby

Regression Issue: CrewAI 0.74.0 Fails to Recognize Supported SQLite Version

Description:

I've encountered this very same regression issue where CrewAI 0.70.1 works successfully when creating a new crew, but CrewAI 0.74.0 fails to recognize the supported version of SQLite.

Reproduction Steps:

  1. Create a new project with a requirements.txt file containing:
crewai==0.70.1
crewai-tools
  1. Run pip install -r requirements.txt and then crewai create crew exampleproject1. This works successfully.
  2. Update the requirements.txt file to:
crewai==0.74.0
crewai-tools
  1. Run pip install -r requirements.txt and then crewai create crew exampleproject2. This fails with the error message:
RuntimeError: Your system has an unsupported version of sqlite3. Chroma requires sqlite3 >= 3.35.0.

Environment:

  • Running on a brand new project on a new repository on a GitHub codespace
  • Python 3.12.1

Additional Information:

  • Running sqlite3 --version returns 3.45.3 2024-04-15 13:34:05 8653b758870e6ef0c98d46b3ace27849054af85da891eb121e9aaa537f1e8355 (64-bit), which meets the required version.

I'm picking up my interest in this project after a few months away and so I will stick with v0.70.1 for now since this is working...

MrSimonC avatar Oct 18 '24 22:10 MrSimonC

A bit of an update from me… After looking into this for quite a while, I can now confirm that CrewAI code is actually fine, it's all to do with the users set up.

First thing I confirm everything is working correctly on version crewai==0.74.2 and crewai-tools==0.13.2. On my set up, I was trying to use GitHub code spaces. It turns out the universal image uses Ubuntu LTS 20 with a very old version of sqlite3. When Python is installed, it looks for the locally installed version of sqlite3 and uses that. Therefore, if one has an old version of sqlite3, updating Python makes no difference. Abandoning the GitHub Codespaces universal image for python:1-3.12-bullseye this also comes with an old version of sqlite3 - making it non viable to run with CrewAI.

In the end, to get it working, I pulled the latest (pinned) ubuntu image mcr.microsoft.com/vscode/devcontainers/base:ubuntu-24.04 then installed python3 after. This comes with a much higher version of sqlite3 and resolves the issue, then CrewAI quickstart works well.

MrSimonC avatar Oct 23 '24 22:10 MrSimonC

got same sqlite error running crewai create crew my_project on Ubuntu, in fresh venv, with pip install crewai but pip install crewai==0.74.0 works fine

toadlyBroodle avatar Oct 24 '24 01:10 toadlyBroodle

Same issue faced with Azure App Service deployments with the latest version of crewai Dear @joaomdmoura - we are also facing this issue and are unable to apply the workaround as well . As a result stuck with the earlier version of crewai which does not have have the chromadb dependency.

tsukhu avatar Nov 14 '24 05:11 tsukhu

A bit of an update from me… After looking into this for quite a while, I can now confirm that CrewAI code is actually fine, it's all to do with the users set up.

First thing I confirm everything is working correctly on version crewai==0.74.2 and crewai-tools==0.13.2. On my set up, I was trying to use GitHub code spaces. It turns out the universal image uses Ubuntu LTS 20 with a very old version of sqlite3. When Python is installed, it looks for the locally installed version of sqlite3 and uses that. Therefore, if one has an old version of sqlite3, updating Python makes no difference. Abandoning the GitHub Codespaces universal image for python:1-3.12-bullseye this also comes with an old version of sqlite3 - making it non viable to run with CrewAI.

In the end, to get it working, I pulled the latest (pinned) ubuntu image mcr.microsoft.com/vscode/devcontainers/base:ubuntu-24.04 then installed python3 after. This comes with a much higher version of sqlite3 and resolves the issue, then CrewAI quickstart works well.

can you provide your devcontainer.json file? I am having issues with having python and pip installed

arturogf avatar Nov 27 '24 11:11 arturogf

Sure. Here you go (ignore / remove out the customizations if you like):

{
	"name": "CrewAI Example",
	"image": "mcr.microsoft.com/vscode/devcontainers/base:ubuntu-24.04",
	"customizations": {
		"vscode": {
			"extensions": [
				"GitHub.copilot-chat",
				"GitHub.copilot"
			]
		}
	},
	"features": {
		"ghcr.io/devcontainers/features/python:1": {}
	}
}

MrSimonC avatar Nov 27 '24 14:11 MrSimonC

This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Dec 28 '24 12:12 github-actions[bot]

This issue was closed because it has been stalled for 5 days with no activity.

github-actions[bot] avatar Jan 02 '25 12:01 github-actions[bot]

related https://github.com/crewAIInc/crewAI/issues/1841

4F2E4A2E avatar Jan 02 '25 20:01 4F2E4A2E