centos7 編譯安裝python3.7,運行django 報錯:SQLite 3.8.3 or later is required
yum中的SQLite 版本過低,手動升級:
wget https://www.sqlite.org/2019/sqlite-autoconf-3270200.tar.gz
tar -zxvf sqlite-autoconf-3270200.tar.gz
cd sqlite-autoconf-3270200
./configure --prefix=/usr/local
mv /usr/bin/sqlite3 /usr/bin/sqlite3_old
ln -s /usr/local/bin/sqlite3 /usr/bin/sqlite3
export LD_LIBRARY_PATH="/usr/local/lib"#添加到~/.bashrc中
此時django已經可以正常運行,可惜我習慣用jupyter lab 寫一部分django的代碼,但jupyter中仍然報錯,似乎ipython並沒有找到新裝的SQLite。
經過一番搜索,找到解決方法:
需要重新編譯python:
sudo LD_RUN_PATH=/usr/local/lib ./configure --enable-optimizations
sudo LD_RUN_PATH=/usr/local/lib make altinstall
問題解決!