IT_Content

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

누한 2024. 2. 23. 10:21
반응형

The following error message occurred during the development of a Python application related to LLM, Chroma, and Langchain.

 

It seems to occur when testing in a Python3.11 & Linux environment like mine.

 

When proceeding under the same conditions in a Windows environment, the related error did not occur.

 

If you encounter this error, please take note.

 

 

[Error Message]

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

 

[Env]

Rocky LInux 9

Python 3.11

 

[Error description]

The error message means that the version of SQLite3 installed on the system is lower than the minimum version required by the Chroma library, which is 3.35.0. To resolve this issue, SQLite3 must be updated to at least version 3.35.0.

 
 

 

 

[ To solve the issue ]
### How to update SQLite3


Step 1. Check SQLite3 Version
먼저 현재 시스템에 설치된 SQLite3의 버전을 확인합니다. 터미널이나 명령 프롬프트에서 다음 명령어를 실행하세요:

sqlite3 --version

 

First, check the version of SQLite3 installed on your current system. Run the following command in the terminal or command prompt:
You need to install a version higher than the currently installed version.



Step 2. Manual Installation of SQLite3

If the version of SQLite3 on your system is below 3.35.0, you will need to manually install the latest version.

The latest source code for SQLite3 can be downloaded from the official SQLite website (https://www.sqlite.org/download.html).

 

Here is the execution code for the download, extraction, and installation process.

Below is the installation process for version 3.45.1.

 

wget https://www.sqlite.org/2024/sqlite-autoconf-3451000.tar.gz
tar xvfz sqlite-autoconf-3451000.tar.gz
cd sqlite-autoconf-3xxxxxx
./configure --prefix=/usr/local
make
sudo make install

 

 

Typically, updating SQLite3 through this process resolves the issue.

 

However, there are instances where the problem does not get resolved (the same error continues to occur).

In such cases, it is because the installed SQLite3 is not properly registered in the environment variables, and the application is unable to recognize it.

 

This issue can be resolved through the following Step 3.



Step 3. (Optional) If the same error message occurs even after completing the above steps

 

  1. Rebuild the Python virtual environment
    • This can sometimes resolve the issue.
  2. If rebuilding the virtual environment does not solve the problem (environment variable registration needed)
    Locate the SQLite3 binary: After manually installing SQLite3, check the location of the installed binary.
    It is typically located in /usr/local/bin or within /opt. You must know the exact installation location.

    • If you followed the installation process exactly as above, proceed with the next steps without changing the path.

 

Set environment variable:

Add the directory where the SQLite3 library is located to the LD_LIBRARY_PATH environment variable in the shell environment where the Python program is executed.

For example, if the SQLite3 library (libsqlite3.so) is installed in /usr/local/lib, add that path to LD_LIBRARY_PATH.

 

Enter the following environment variable in the command:

export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH

 

 

* Important: This command applies only to the current session.
  That is, to apply it permanently, add the above command to the shell configuration files such as .bash_profile, .bashrc, .zshrc, etc., located in the user's home directory.

 



 


If this does not resolve the issue, it is recommended to downgrade to Python 3.10.

 
 
반응형