centos7 SQLite 版本过低错误

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

问题解决!

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章