您的位置:首页 > 数据库 > SQL

[Django]Solve "No module named _sqlite3" when deploying django in CentOS

2015-07-17 22:06 597 查看

Symptom

When using
python manage.py runserver
in terminal or entering
import sqlite3
in the interpreter shell, the following exception is thrown:

django.core.exceptions.ImproperlyConfigured: Error loading either pysqlite2 or sqlite3 modules (tried in that order): No module named _sqlite3


Environment

CentOS 7

Python 2.7.10

Django 1.8.2

HOWTO fix it:

yum install sqlite-devel

recompile python

./configure –prefix=/usr/local (installing python2.7 without affecting the default one)

make

make altinstall

Reference:

http://stackoverflow.com/questions/21609627/what-should-i-modify-to-solve-the-no-module-named-sqlite3-error-message
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: