【python3】在CentOS7上升级SQLite,并让Python3使用新版SQLite

升级sqlite: https://www.cnblogs.com/richerdyoung/p/12395523.html
安装python3: https://www.cnblogs.com/richerdyoung/p/12396200.html

请先照以上两篇文章的方法,安装好sqlite 和 python3
查看命令

sqlite3 -versionpython3 -V

从新编译python3, 唯一的区别是,在编译时略有不同。
原来的编译过程:

cd /usr/local/python-3.7/./configure --prefix=/usr/local/sbin/python-3.7make && make install

修改为

cd /usr/local/python-3.7/LD_RUN_PATH=/usr/local/lib ./configure LDFLAGS="-L/usr/local/lib" CPPFLAGS="-I/usr/local/include" --prefix=/usr/local/sbin/python-3.7LD_RUN_PATH=/usr/local/lib makemake && make install

照此安装后,已经可以使用最新版SQLite了:

[root@iZuf6gjb9m90kz88rvhbykZ ~]# python3Python 3.7.0 (default, Mar 2 2020, 18:15:12) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linuxType "help", "copyright", "credits" or "license" for more information.>>> import sqlite3>>> sqlite3.sqlite_version'3.28.0'>>> 

相关文章