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