使用python3.6 中的django-admin建立項目的時候報錯python
ImportError: dynamic module does not define module export function (PyInit__sqlite3)sql
python3以上版本安裝sqlite3的解決方案django
wget https://www.sqlite.org/2017/sqlite-autoconf-3170000.tar.gz --no-check-certificatejson
tar xf sqlite-autoconf-3170000.tar.gzspa
cd sqlite-autoconf-3170000/sqlite
./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"get
make && make installit
從新編譯python3.6io
cd Python-3.6.0a1
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編譯
進入python3.6的交互環境
import sqlite3沒報錯說明問題解決