I have CentOS 6
on my system and I’m trying to update SQLite for Python. I’ve installed it from source and executing sqlite --version
returns version 3.33.0
as expected.
However, when I try to check the python SQLite version using import sqlite3; sqlite3.sqlite_version;
I still get the previous SQLite version 3.6.20
.
Software Locations:
Python 3.6.9 - /usr/bin/python3
Sqlite3 - /usr/bin/sqlite3
I’ve tried the solution here, this does not work at all, after updating LD_LIBRARY_PATH
and checking the python SQLite version it still gives ‘3.6.20’, and here, when I try sudo LD_RUN_PATH=
, it gives me the error No such file or directory
, but when I execute it without sudo LD_RUN_PATH=
, it successfully compiles but still gives me SQLite ‘3.6.20’ (Compiled python without uninstalling).
Note: I have multiple python3 versions.
What can I do to resolve this?
2
Answers
When I did it (specifically trying to find a way to update sqlite3 for a running python program; did not work…), I compiled sqlite and got libsqlite3.so.0.8.6, and then replaced the system-wide sqlite3 with that. For me on debian, that was in /usr/lib/x86_64-linux-gnu. I did see (though now I can’t find where) that this way may cause issues when updating in the future. It did update python’s sqlite3 for me though.
You can import specific versions:
Note that this only works on the first import. If sqlite gets imported before pkg_resources, it will take the latest version.