如何在创建Django应用程序时解决没有名为_sqlite3的模块?

2024-04-16 05:11:01 发布

您现在位置:Python中文网/ 问答频道 /正文

我已经在CentOS 2.6上安装了Python3.4版本

我还安装了Django 1.8。

然后我尝试创建如下Django应用程序。

$django-admin.py startproject mysite

$cd mysite
$python3 manage.py startapp poll

我搞错了。我怎样才能克服这种情况。 提前谢谢。

Traceback (most recent call last):
File "/usr/local/lib/python3.4/site-packages/django/db/backends/sqlite3/base.py", line 31, in <module>
from pysqlite2 import dbapi2 as Database
ImportError: No module named 'pysqlite2'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.4/site-packages/django/db/backends/sqlite3/base.py", line 33, in <module>
from sqlite3 import dbapi2 as Database
...
ImportError: No module named '_sqlite3'

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
...
raise ImproperlyConfigured("Error loading either pysqlite2 or sqlite3 modules (tried in that order): %s" % exc)
django.core.exceptions.ImproperlyConfigured: Error loading either pysqlite2 or sqlite3 modules (tried in that order): No module named '_sqlite3'

Tags: djangoinfrompymostlineexceptioncall