Django - No module named _sqlite3

前端 未结 9 1649

I have django 1.4 installed on my rhel 5. By default rhel 5 has python 2.4 in it but to use django 1.4 I manually installed python 2.7.3 The development server is running fine b

9条回答
  •  悲&欢浪女
    2021-02-12 13:24

    At the django.db.backends.sqlite3, it tries to

    try:
        try:
            from pysqlite2 import dbapi2 as Database
        except ImportError:
            from sqlite3 import dbapi2 as Database
    except ImportError as exc:
        from django.core.exceptions import ImproperlyConfigured
        raise ImproperlyConfigured("Error loading either pysqlite2 or sqlite3 modules (tried in that order): %s" % exc)
    

    So one of the modules named sqlite3 or pysqlite2 is not installed. Try to install them

    $ pip install sqlite3 # or pysqlite2
    

    Update

    sqlite3 and pysqlite2 are part of Python, therefore these two packages are not in PyPi anymore.

提交回复
热议问题