Find answers from the community

Updated 4 months ago

Hi, i am having some problems while

At a glance
The community member is having issues running their Python 3.9 application due to a ModuleNotFoundError for the pysqlite3 module. They have tried installing the pysqlite3-binary package but encountered an error. The issue seems to be specific to running the application on macOS, as the community member notes that they do not have the same problem when running on Ubuntu.

Another community member suggests that the issue may be related to how Python 3.9 was compiled, and recommends using pyenv to manage and install the Python version. The community members also discuss potential issues with the sqlite3 version required by the chroma library, and suggest upgrading to Python 3.12 as a possible solution.

However, there is no explicitly marked answer in the comments, and the community members do not seem to have found a definitive solution to the problem.

Useful resources
Hi, i am having some problems while trying to run my application. I am using python3.9 and for some time i had this problem running the code because of this problem:

Plain Text
File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/app/main.py", line 1, in <module>
    __import__('pysqlite3')
ModuleNotFoundError: No module named 'pysqlite3'


while trying to install the module i get the following error

Plain Text
ERROR: Could not find a version that satisfies the requirement pysqlite3-binary==0.5.2 (from versions: none)
ERROR: No matching distribution found for pysqlite3-binary==0.5.2


Do you recommend some version of python where i can stop having this kind of problem?
Some how running on Mac OS, is always bringing me this kind of errors
L
J
5 comments
I think this means your version of python3 was compiled with support for sqlite? Maybe?
I would use pyenv to manage and install your python version
Hi Logan! I'm currently working with Fran, and the problem we are facing is that I have no problems when dockerizing or even running the project (using Ubuntu) but Fran has that error he mentioned (Mac OS). We also believe that there could be trouble with the python version we are using (3.9.19) because when managing dependencies we had to include the next lines in our main.py otherwise the app won't start:

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

We got that from investigatin the following error, that is the one we used to have before adding those 3 lines in our main.py:
(...)
File "/venv/lib/python3.9/site-packages/llama_index/vector_stores/chroma/init.py", line 1, in <module>
from llama_index.vector_stores.chroma.base import ChromaVectorStore
File "/venv/lib/python3.9/site-packages/llama_index/vector_stores/chroma/base.py", line 7, in <module>
import chromadb
File "/venv/lib/python3.9/site-packages/chromadb/init.py", line 78, in <module>
raise RuntimeError(
RuntimeError: Your system has an unsupported version of sqlite3. Chroma requires sqlite3 >= 3.35.0.
Please visit https://docs.trychroma.com/troubleshooting#sqlite to learn how to upgrade.

We believe that if we upgrade our python version to 3.12 for example, we could solve this problem, but maybe if you have already seen something similar with this python version (3.9) and chroma, your advice could save us some time of work πŸ™‚ Thanks a lot!
Funny thing is that i have no problem running the app (ubuntu) with those 3 lines for importing that sqlite3 module, but Fran cannot run it and recieves that error (mac os), do you have any info about that?
I have no idea about this -- this is beyond stuff I've run into before. Seems like an issue with how you installed python though tbh
Add a reply
Sign up and join the conversation on Discord