pythonlinuxsqliteredhat

sqlite3 and python on redhat 7.9


I am trying to install python 3.13.2 from sources since I don't have root access on my machine (OS RedHat 7.9). I need the package sqlite3 in order to run jupyter, but it is not installed on the system hence Python disables it.

Here is the command I launch to install:

./configure --prefix my_install_directory --enable-optimizations --disable-test-modules && make -j16

Here is what the configure script says:

checking for sqlite3 >= 3.15.2... no
checking for sqlite3.h... no

And here is what it says at the end of the make command:

The following modules are *disabled* in configure script:
_sqlite3

How can I install sqlite3 on my machine without root privileges and have python find it when I install it ?


Solution

  • Answering my own question in case it helps someone:

    1. Install the source version of sqlite: https://www.sqlite.org/2025/sqlite-src-3490000.zip
    2. Add path_to_install_directory/sqlite/lib to LD_LIBRARY_PATH
    3. Add path_to_install_directory/sqlite/bin to PATH
    4. Compile python with CPPFLAGS="-I path_to_install_directory/sqlite/include" ./configure && make -j16 install