I recently installed python from the source and used the following commands to install both SQLite from the source and Python 2.7.13 from the source.
for SQLite3, you can use the following commands: $ SQLITE_INSTALL_LOCATION
$ curl -O http://www.sqlite.org/sqlite-autoconf-3070603.tar.gz $ tar xvfz sqlite-autoconf-3070603.tar.gz $ cd sqlite-autoconf-3070603 $ ./configure --prefix=$SQLITE_INSTALL_LOCATION --disable-static CFLAGS="-g" $ make && make install
Then, when I compiled my python, I edited setup.py in the Python root source
$ curl -O https://www.python.org/ftp/python/2.7.13/Python-2.7.13.tgz $ tar xvfz Python-2.7.13.tgz
Python-2.7.13 / setup.py - add the path to your SQLite installation: `` `
... # We hunt for #define SQLITE_VERSION "nnn" # We need to find >= sqlite version 3.0.8 sqlite_incdir = sqlite_libdir = None sqlite_inc_paths = [ '/usr/include', '/usr/include/sqlite', '/usr/include/sqlite3', '/usr/local/include', '/usr/local/include/sqlite', '/usr/local/include/sqlite3', $SQLITE_INSTALL_LOCATION/include, ] ...
After you have changed setup.py in the python source code, compile and install python, assuming the installation location is $ PYTHON_INSTALL_LOCATION
$ cd Python-2.7.13 $ LD_RUN_PATH=$SQLITE_INSTALL_LOCATION/lib ./configure --prefix=$PYTHON_INSTALL_LOCATION --enable-shared --enable-unicode=ucs4 $ LD_RUN_PATH=$SQLITE_INSTALL_LOCATION/lib make $ LD_RUN_PATH=$SQLITE_INSTALL_LOCATION/lib make install
After that, you should have a version of Python with SQLite3 support installed in $ PYTHON_INSTALL_LOCATION / bin / python
Hope this helps!
source share