Create a Django app in the CentOS system with the following error:
Django.core.exceptions.ImproperlyConfigured:Error loading either PYSQLITE2 or Sqlite3 modules (tried in this order): No m Odule named ' _sqlite3 '
Solution:
Install sqlite-devel-3.3.6-2.x86_64.rpm:
The software package is available in the CentOS repository and can be installed directly via Yum:
[email protected] mysite]# Yum install Sqlite-devel
Loaded plugins: Fastestmirror, LangPacks
Loading mirror speeds from cached hostfile
* base:mirrors.aliyun.com
* extras:mirrors.yun-idc.com
* Updates:mirrors.btte.net
Package sqlite-devel-3.7.17-4.el7.x86_64 is installed and is the latest version
No processing required
Since I have installed it, it is no longer installed here.
Reinstall python3.3:
[[email protected] python-3.3.0]# ls
Build config.sub Grammar libpython3.3m.a makefile.pre Objects pybuilddir.txt Python Tools
Config.guess Configure Include LICENSE Makefile.pre.in Parser pyconfig.h python-gdb.py
Config.log configure.ac install-sh Mac Misc PC pyconfig.h.in README
Config.status Doc Lib Makefile Modules pcbuild python setup.py
The current directory is the python3.3 installation directory: Run the following command:
./configure--prefix=/usr/local/python
Make
Make install
- 3
After the above 2 steps, re-import Sqlite3 try:
[Email protected] mysite]# python3.3
Python 3.3.0 (Default, Oct 10 2014, 11:52:13)
[GCC 4.8.2 20140120 (Red Hat 4.8.2-16)] on Linux
Type "Help", "copyright", "credits" or "license" for more information.
>>> Import Sqlite3
>>>
No error, instructions to import normal.
Introduction of Sqlite3 in Centos7 python3.5