首页 > 代码库 > python3.4 "ImportError: No module named '_sqlite3'"
python3.4 "ImportError: No module named '_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'"
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。