ModuleNotFoundError: No module named '_sqlite3'

在服务器端安装完Jupyter Notebook启动时,出现错误:

Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/local/python3.5/lib/python3.5/sqlite3/__init__.py", line 23, in 
    from sqlite3.dbapi2 import *
  File "/usr/local/python3.5/lib/python3.5/sqlite3/dbapi2.py", line 27, in 
    from _sqlite3 import *
ModuleNotFoundError: No module named '_sqlite3'

原因可能是因为安装python3的时候没有找到安装sqlite3.so的库。
使用:

yum install sqlite*

然后重新编译安装python3即可解决。
如果安装失败,可以自己下载rpm包安装,大约需要的包有sqlite-devel, sqlite-autoconf,sqlite-tools

你可能感兴趣的:(python,sqlite3)