Introduction of Sqlite3 in Centos7 python3.5

Source: Internet
Author: User
Tags sqlite

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:

  1. 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.

  2. 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. 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.