centos7默认安装的sqlite3版本为3.7.17,我安装的django版本为django》2.2.X,要求sqlite3的版本最低为3.8.3,处理方式有两种:
1.安装低版本的django2.1
2.升级sqlite3.方法如下:
wget https://www.sqlite.org/2019/sqlite-autoconf-3280000.tar.gz
tar -zxvf sqlite-autoconf-3280000.tar.gz
cd sqlite-autoconf-3280000
./configure --prefix=/usr/local
make && make install
find /usr/ -name sqlite3
删除不必要的文件
rm -rf sqlite-autoconf-3280000*
mv /usr/bin/sqlite3 /usr/bin/sqlite3_old
ln -s /usr/local/bin/sqlite3 /usr/bin/sqlite3
vim ~/.bashrc
export LD_LIBRARY_PATH="/usr/local/lib"
source ~/.bashrc
升级完成,查看版本为最新sqlite3版本。
python查看sqlite版本信息:
[root@crawler-03 bin]# python36
Python 3.6.8 (default, Apr 4 2019, 10:34:20)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-36)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sqlite3
>>> sqlite3.sqlite_version
'3.28.0'
>>>