Quantcast
Channel: Updating the SQLite version used by Python 3 on CentOS 7 - Unix & Linux Stack Exchange
Viewing all articles
Browse latest Browse all 2

Answer by Douglas Ohlhorst for Updating the SQLite version used by Python 3 on CentOS 7

$
0
0

You will need to either find an RPM with the newer version or you will need to download the precompiled binaries for your OS (https://www.sqlite.org/download.html) or download source/compile/install the software.

It is normally recommend to stay with RPMs for better management of software (for installing, upgrading, etc.) though if you cannot find the RPM that will work feel free to try installing the precompiled version or compile the software and install it. This is often done on Linux systems to get the latest or a specific version of the software one needs to run certain software.

After compiling SQLite you should be able to point to the libraries for python, a quick way is to set you LD_LIBRARY_PATH to the output of lib directory you would have gotten from the compile of SQLite:

Libraries have been installed in: /usr/local/sqlite-3.22.0/lib If you ever happen to want to link against installed libraries in a given directory, LIBDIR, you must either use libtool, and specify the full pathname of the library, or use the '-LLIBDIR' flag during linking and do at least one of the following: - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable during execution - add LIBDIR to the 'LD_RUN_PATH' environment variable during linking - use the '-Wl,-rpath -Wl,LIBDIR' linker flag - have your system administrator add LIBDIR to '/etc/ld.so.conf'

If you run your python before setting your libraries you will see the old version:

python3.6 -c "import sqlite3; print(sqlite3.sqlite_version)"
3.7.17

With the new version:

export LD_LIBRARY_PATH=/usr/local/sqlite-3.22.0/lib
python3.6 -c "import sqlite3; print(sqlite3.sqlite_version)"
3.22.0

Depending on your environment you might need to setup this in your code or before your code gets run, depending on how you manage different versions of libraries. Though the output from the compile can give you some ideas on this.


Viewing all articles
Browse latest Browse all 2

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>