在centos7上安裝django測試的時候,出現(xiàn):raise ImproperlyConfigured('SQLite 3.8.3 or later is required (found %s).' % Database.sqlite_version)
django.core.exceptions.ImproperlyConfigured: SQLite 3.8.3 or later is required (found 3.7.17)
這是由于centos7默認(rèn)安裝的sqlite3版本為3.1.17,而我安裝的django版本為django2.2.3疚宇,要求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版本。
-