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

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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'"的主要内容,如果未能解决你的问题,请参考以下文章

gerrit importer 使用方法

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

ruby max_value_importer.rb

ruby max_value_importer.rb

Magmi 属性集 Importer 不设置产品属性

如何处理Python3.4 使用pymssql 乱码问题