LD_PRELOAD的妙用,让python支持自己编译的Sqlite
LD_PRELOAD=/usr/local/sqlite/lib/libsqlite3.so.0 python3 -c "import sqlite3; print("sqlite3.sqlite_version");"
会输出
3.27.1
而 python3 -c "import sqlite3; print("sqlite3.sqlite_version");",输出
3.22.0
xxx@xxx-Alienware-15-R4:/usr/local/sqlite$ LD_PRELOAD=/usr/local/sqlite/lib/libsqlite3.so.0 python3 -c "import sqlite3; print("sqlite3.sqlite_version");" 3.27.1 xxx@xxx-Alienware-15-R4:/usr/local/sqlite$ python3 -c "import sqlite3; print("sqlite3.sqlite_version");" 3.22.0