码迷,mamicode.com
首页 > 数据库 > 详细

python3.4 "ImportError: No module named '_sqlite3'"

时间:2017-06-09 17:25:42      阅读:229      评论:0      收藏:0      [点我收藏+]

标签:sqlite3

python3.4导入sqlite3是报错,如下:

>>> import sqlite3

Traceback (most recent call last):

  File "<input>", line 1, in <module>

    import sqlite3

  File "/usr/local/python3.4/lib/python3.4/sqlite3/__init__.py", line 23, in <module>

    from sqlite3.dbapi2 import *

  File "/usr/local/python3.4/lib/python3.4/sqlite3/dbapi2.py", line 26, in <module>

    from _sqlite3 import *

ImportError: No module named ‘_sqlite3‘


解决:

yum -y install sqlite-devel

重新编译安装python3.4

wget https://www.python.org/ftp/python/3.4.0/Python-3.4.0.tar.xz

./configure --enable-loadable-sqlite-extensions --prefix=/usr/local/python3.4

make&&make install


python3.4 "ImportError: No module named '_sqlite3'"

标签:sqlite3

原文地址:http://leyin01.blog.51cto.com/9062123/1933829

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!