Python3以上版本安装sqlite3的解决方案

python
0 343

csroad
csroad 举报
2019-07-22
Python3以上版本安装sqlite3的解决方案

安装sqlite3的包

(1)安装sqlite3的包

$ wget https://www.sqlite.org/2019/sqlite-autoconf-3270200.tar.gz --no-check-certificate

$ tar zxvf sqlite-autoconf-3270200.tar.gz

$ cd sqlite-autoconf-3270200

$ ./configure --prefix=/usr/local/sqlite3 --disable-static --enable-fts5 --enable-json1 CFLAGS="-g -O2 -DSQLITE_ENABLE_FTS3=1 -DSQLITE_ENABLE_FTS4=1 -DSQLITE_ENABLE_RTREE=1"

(2)对python3进行重新编译

$ cd Python-3.6.2

$ LD_RUN_PATH=/usr/local/sqlite3/lib ./configure LDFLAGS="-L/usr/local/sqlite3/lib" CPPFLAGS="-I /usr/local/sqlite3/include"

$ LD_RUN_PATH=/usr/local/sqlite3/lib make

$ LD_RUN_PATH=/usr/local/sqlite3/lib sudo make install

通过上述安装过程,终于可以顺利实现python对sqlite3的支持了。


版权声明:本文为博主原创文章,转载请附上博文链接!