3

我在 CentOS 2.6 上安装了 python 3.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'
4

2 回答 2

3

跑步sudo apt-get install python-sqlite对我有用

于 2015-09-11T12:59:52.637 回答
0

我在 Makefile 中的“VERSION=3.5”行下方附加了“PYTHONVERSION=3.5”并重新编译。有效。

于 2016-02-02T19:00:20.480 回答