在centos7环境中常规安装python3的话无法支持sqlite3和ssl,所以在安装pytho3是需要带上sqlite3库和ssl库:
下载编译安装sqlite3:
# wget https://www.sqlite.org/2017/sqlite-autoconf-3170000.tar.gz --no-check-certificate
# ./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"
# make && make install
完成编译sqlite3后,在进行下载编译安装python3(已经完成编译安装的话,需要重新编译安装)
# wget https://www.python.org/ftp/python/3.6.2/Python-3.6.2.tar.xz
# LD_RUN_PATH=/usr/local/sqlite3/lib ./configure --prefix=/usr/local/python36 --with-ssl 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 make install
完成以上操作即可完成python3对sqlite3和ssl的支持