-
-
Save defulmere/8b9695e415a44271061cc8e272f3c300 to your computer and use it in GitHub Desktop.
# ⚠️ USE AT YOUR OWN RISK | |
# first: pip install pysqlite3-binary | |
# then in settings.py: | |
# these three lines swap the stdlib sqlite3 lib with the pysqlite3 package | |
__import__('pysqlite3') | |
import sys | |
sys.modules['sqlite3'] = sys.modules.pop('pysqlite3') | |
DATABASES = { | |
'default': { | |
'ENGINE': 'django.db.backends.sqlite3', | |
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), | |
} | |
} |
Can anyone explain about the BASE_DIR mentioned in the DATABASES
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
I got an error message -->
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
NameError: name 'BASE_DIR' is not defined
help to get out of this
im on a streamlit project and im using python3.10
This was helpful, worked for me as well !
I was getting following error while trying to run chromadb example code using my python3.10.8 venv3.10:
File "~/venv3.10/lib/python3.10/site-packages/chromadb/__init__.py", line 36, in <module> raise RuntimeError( RuntimeError: Your system has an unsupported version of sqlite3. Chroma requires sqlite3 >= 3.35.0.
I executed following steps to resolve this error:
- Inside my python3.10.8's virtual environment i.e. venv3.10, installed pysqlite3-binary using command:
pip install pysqlite3-binary
- Added these 3 lines in
venv3.10/lib/python3.10/site-packages/chromadb/__init__.py
at the beginning:__import__('pysqlite3') import sys sys.modules['sqlite3'] = sys.modules.pop('pysqlite3')
And my code worked like a charm!
Thank you all!
I can also confirm that @medhask fix works for fixing ChromaDb when running in a 3.11 Debian DevContainer!
Sorry guys, after following the steps above. Python complains a new error as below:
File "/usr/local/lib/python3.9/site-packages/chromadb/init.py", line 57, in
if sqlite3.sqlite_version_info < (3, 35, 0):
AttributeError: module 'pysqlite3' has no attribute 'sqlite_version_info'
@hpwahyao hi friends I am also encountering with this error now, has you solved this problem?
I am having the same problem and I think I have tried everything listed here. I'm on a mac with Python 3.8.
I am trying upgrading to Python 3.11 now.
Note that I definitely have the newer version of sqlite3 on my machine. running sqlite3 reports 3.37.0
However, inside my code Chroma finds an older version somehow.
@le052301 @hpwahyao @Vikho @gwc4github if you look at the ChromaDB python client code you'll see that it's already equipped to use pysqlite3 but only if the google.colab module is installed:
You might be able to work around your issue by installing the google-colab
and pysqlite-binary
Python packages into your environment.
Sorry guys, after following the steps above. Python complains a new error as below:
File "/usr/local/lib/python3.9/site-packages/chromadb/init.py", line 57, in if sqlite3.sqlite_version_info < (3, 35, 0): AttributeError: module 'pysqlite3' has no attribute 'sqlite_version_info'
Sorry guys, after following the steps above. Python complains a new error as below:
File "/usr/local/lib/python3.9/site-packages/chromadb/init.py", line 57, in if sqlite3.sqlite_version_info < (3, 35, 0): AttributeError: module 'pysqlite3' has no attribute 'sqlite_version_info'
- Go to inti.py file inside the
venv3.10/lib/python3.10/site-packages/chromadb/__init__.py
. - goto line number 61.
if sqlite3.sqlite_version_info < (3, 35, 0):
- and paste these three lines below it and make sure to indent it.
__import__('pysqlite3')
import sys
sys.modules['sqlite3'] = sys.modules.pop('pysqlite3')
- Now make sure to comment this:
if IN_COLAB:
# In Colab, hotswap to pysqlite-binary if it's too old
import subprocess
import sys
subprocess.check_call(
[sys.executable, "-m", "pip", "install", "pysqlite3-binary"]
)
__import__("pysqlite3")
sys.modules["sqlite3"] = sys.modules.pop("pysqlite3")
else:
raise RuntimeError(
"\033[91mYour system has an unsupported version of sqlite3. Chroma requires sqlite3 >= 3.35.0.\033[0m\n"
"\033[94mPlease visit https://docs.trychroma.com/troubleshooting#sqlite to learn how to upgrade.\033[0m"
)
It Worked for me when running in python 3.8 ubuntu 20.04
You do not need to modify anything. To bypass the Colab check, you can create an empty folder google/colab
in the site packages folder. That way on the Chroma __init__.py
when it tries to do the import google.colab
check it will pass, and thus replace sqlite3 with pysqlite3
You do not need to modify anything. To bypass the Colab check, you can create an empty folder
google/colab
in the site packages folder. That way on the Chroma__init__.py
when it tries to do theimport google.colab
check it will pass, and thus replace sqlite3 with pysqlite3
Thanks
Sorry guys, after following the steps above. Python complains a new error as below:
File "/usr/local/lib/python3.9/site-packages/chromadb/init.py", line 57, in if sqlite3.sqlite_version_info < (3, 35, 0): AttributeError: module 'pysqlite3' has no attribute 'sqlite_version_info'Sorry guys, after following the steps above. Python complains a new error as below:
File "/usr/local/lib/python3.9/site-packages/chromadb/init.py", line 57, in if sqlite3.sqlite_version_info < (3, 35, 0): AttributeError: module 'pysqlite3' has no attribute 'sqlite_version_info'
- Go to inti.py file inside the
venv3.10/lib/python3.10/site-packages/chromadb/__init__.py
.- goto line number 61.
if sqlite3.sqlite_version_info < (3, 35, 0):
- and paste these three lines below it and make sure to indent it.
__import__('pysqlite3') import sys sys.modules['sqlite3'] = sys.modules.pop('pysqlite3')
- Now make sure to comment this:
if IN_COLAB: # In Colab, hotswap to pysqlite-binary if it's too old import subprocess import sys subprocess.check_call( [sys.executable, "-m", "pip", "install", "pysqlite3-binary"] ) __import__("pysqlite3") sys.modules["sqlite3"] = sys.modules.pop("pysqlite3") else: raise RuntimeError( "\033[91mYour system has an unsupported version of sqlite3. Chroma requires sqlite3 >= 3.35.0.\033[0m\n" "\033[94mPlease visit https://docs.trychroma.com/troubleshooting#sqlite to learn how to upgrade.\033[0m" )
It Worked for me when running in python 3.8 ubuntu 20.04
It worked for me also
This did not solve the error for me.
I tried this couple of months ago and worked, however now it doesn't.
the issue is that I'm not even able to install the dependency:
pip install pysqlite3-binary
ERROR: Could not find a version that satisfies the requirement pysqlite3-binary (from versions: none)
ERROR: No matching distribution found for pysqlite3-binary
I saw the packages are still with the same name on pypi and they were not removed, but not sure what changed and does not work now.
Any ideas?
Bump, I'm having the same issue as @cmosta0 . Any workaround?
Bump, I'm having the same issue as @cmosta0 . Any workaround?
Hi. In my case, the issue seems to be related the OS. Actually to be able to install using pip, I needed to use --platform
on pip install
command, otherwise every attempt just returned the same error mentioned above. (I'm using macbook-pro M2)
@cmosta0 Hey what is the pip install command you used to successfully install the binary? Thanks in advance
thinks , u solve my problem, very thinks
@defulmere Thank you very much. This worked for me as well.
This was helpful, worked for me as well !
I was getting following error while trying to run chromadb example code using my python3.10.8 venv3.10:
File "~/venv3.10/lib/python3.10/site-packages/chromadb/__init__.py", line 36, in <module> raise RuntimeError( RuntimeError: Your system has an unsupported version of sqlite3. Chroma requires sqlite3 >= 3.35.0.
I executed following steps to resolve this error:
- Inside my python3.10.8's virtual environment i.e. venv3.10, installed pysqlite3-binary using command:
pip install pysqlite3-binary
- Added these 3 lines in
venv3.10/lib/python3.10/site-packages/chromadb/__init__.py
at the beginning:__import__('pysqlite3') import sys sys.modules['sqlite3'] = sys.modules.pop('pysqlite3')
worked like magic! Thank you!
I tried this couple of months ago and worked, however now it doesn't. the issue is that I'm not even able to install the dependency:
pip install pysqlite3-binary ERROR: Could not find a version that satisfies the requirement pysqlite3-binary (from versions: none) ERROR: No matching distribution found for pysqlite3-binary
I saw the packages are still with the same name on pypi and they were not removed, but not sure what changed and does not work now.
Any ideas?
It also happened to me, until I realized it only works on Linux.
What do we have to do, if we are deploying on streamlit?
I found that on your local, just delete your virtual environment, recreate it with python 3.10, run pip install -r requirements.txt
and you'll be good.
I tried this couple of months ago and worked, however now it doesn't. the issue is that I'm not even able to install the dependency:
pip install pysqlite3-binary ERROR: Could not find a version that satisfies the requirement pysqlite3-binary (from versions: none) ERROR: No matching distribution found for pysqlite3-binary
I saw the packages are still with the same name on pypi and they were not removed, but not sure what changed and does not work now.
Any ideas?It also happened to me, until I realized it only works on Linux.
Persistent Issue: Unsupported version of sqlite3. Chroma requires sqlite3 >= 3.35.0
What is the solution if we are deploying streamlit App.
Our Streamlit App is working fine on local but after Deployment on Streamlit Cloud the issue occurred
Hey, so I was able to bypass this issue by just adding pysqlite3-binary
to requirements.txt
Did not have to add any versioning, or other code.
This was helpful, worked for me as well !
I was getting following error while trying to run chromadb example code using my python3.10.8 venv3.10:
File "~/venv3.10/lib/python3.10/site-packages/chromadb/__init__.py", line 36, in <module> raise RuntimeError( RuntimeError: Your system has an unsupported version of sqlite3. Chroma requires sqlite3 >= 3.35.0.
I executed following steps to resolve this error:
- Inside my python3.10.8's virtual environment i.e. venv3.10, installed pysqlite3-binary using command:
pip install pysqlite3-binary
- Added these 3 lines in
venv3.10/lib/python3.10/site-packages/chromadb/__init__.py
at the beginning:__import__('pysqlite3') import sys sys.modules['sqlite3'] = sys.modules.pop('pysqlite3')
And my code worked like a charm!
Thank you so much, this worked
How to manage updating ~/venv3.10/lib/python3.10/site-packages/chromadb/__init__.py
in server running with docker?
这很有帮助,对我也很有用!
当我尝试使用我的 python3.10.8 venv3.10 运行 chromadb 示例代码时出现以下错误:
File "~/venv3.10/lib/python3.10/site-packages/chromadb/__init__.py", line 36, in <module> raise RuntimeError( RuntimeError: Your system has an unsupported version of sqlite3. Chroma requires sqlite3 >= 3.35.0.
我执行了以下步骤来解决此错误:
- 在我的 python3.10.8 的虚拟环境即 venv3.10 中,使用命令安装了 pysqlite3-binary:
pip install pysqlite3-binary
venv3.10/lib/python3.10/site-packages/chromadb/__init__.py
在开头添加了以下3行:__import__('pysqlite3') import sys sys.modules['sqlite3'] = sys.modules.pop('pysqlite3')
我的代码运行得非常好!
very good ! 3Q
Recently I moved from Windows to Mac. In both the systems I was running code in devontainers. Not sure why, but I am getting following error in devcontainer on mac. Any idea?
ERROR: Could not find a version that satisfies the requirement pysqlite3-binary (from versions: none) ERROR: No matching distribution found for pysqlite3-binary
Hi guys I working locally on Windows and using AppFunction based on Linux and I want to using this option only when OS is Linux I've tried something like this
`if platform.system() == "Linux":
import("pysqlite3")
import sys
sys.modules["sqlite3"] = sys.modules.pop("pysqlite3")
logging.info("pysqlite3 imported and changing sqlite3.")
import sqlite3 # noqa: E402
logging.info("Using version sqlite3 %s", sqlite3.sqlite_version)`
for linux I installing pysqlite3-binary with other lib using requirements.txt during uploading a pipeline I don't have any errors but It's seems like pysqlite3-binary didn't overwrite.
Do you have any sugestions?
Hello all. I am using an Azure web app. Azure won't update its sqlite version on their web app containers, so I am trying to do that during build and deployment. I do not have access to the init.py file in chroma. I am not sure how to create the google/colab folder during my build/deployment process. Any pointers here would be much appreciated!
This was helpful, worked for me as well !
I was getting following error while trying to run chromadb example code using my python3.10.8 venv3.10:
File "~/venv3.10/lib/python3.10/site-packages/chromadb/__init__.py", line 36, in <module> raise RuntimeError( RuntimeError: Your system has an unsupported version of sqlite3. Chroma requires sqlite3 >= 3.35.0.
I executed following steps to resolve this error:
pip install pysqlite3-binary
venv3.10/lib/python3.10/site-packages/chromadb/__init__.py
at the beginning:And my code worked like a charm!