为什么
from pysqlite2 import dbapi2 as sqlite
原因
ImportError:没有名为 pysqlite2 的模块
pysqlite2 不是已经安装在 Python 2.6.5 中了吗?
该模块称为sqlite3. pysqlite2是模块在成为 Python 标准库的一部分之前的名称。
您可能想在代码中使用它:
import sqlite3
标准文档在这里:http ://docs.python.org/library/sqlite3.html
编辑:只是为了涵盖所有基础:
该sqlite3模块还有一个dbapi2子成员,但您不需要直接使用它。该sqlite3模块直接公开所有dbapi2成员。