centos 我无法修复“模块未找到错误:没有名为“mysqlite2”的模块“

mzsu5hc0  于 2022-11-07  发布在  Mysql
关注(0)|答案(1)|浏览(143)

我在一个全新的centos上安装了python3.9和jupyter笔记本,但是我得到了一个错误消息说“sqlite3是丢失的”,所以我添加了sqlite3,并在没有删除python3.9的情况下重新安装,但是我仍然得到消息说sqlite3是丢失的,我该怎么办?

[jirow04@jirow04 centos 初期インストール設定]$ jupyter notebook
Traceback (most recent call last):
  File "/home/jirow04/.local/lib/python3.9/site-packages/notebook/services/sessions/sessionmanager.py", line 9, in <module>
    import sqlite3
  File "/usr/local/lib/python3.9/sqlite3/__init__.py", line 57, in <module>
    from sqlite3.dbapi2 import *
  File "/usr/local/lib/python3.9/sqlite3/dbapi2.py", line 27, in <module>
    from _sqlite3 import *
ModuleNotFoundError: No module named '_sqlite3'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/jirow04/.local/bin/jupyter-notebook", line 5, in <module>
    from notebook.notebookapp import main
  File "/home/jirow04/.local/lib/python3.9/site-packages/notebook/notebookapp.py", line 83, in <module>
    from .services.sessions.sessionmanager import SessionManager
  File "/home/jirow04/.local/lib/python3.9/site-packages/notebook/services/sessions/sessionmanager.py", line 12, in <module>
    from pysqlite2 import dbapi2 as sqlite3
ModuleNotFoundError: No module named 'pysqlite2'
[jirow04@jirow04 centos 初期インストール設定]$ sqlite3 --version
3.7.17 2013-05-20 00:56:22 118a3b35693b134d56ebd780123b7fd6f1497668
wr98u20j

wr98u20j1#

很久以前我在python 3. 5上遇到了问题,我不能运行jupyter笔记本。顺便说一句,我在ubuntu上。
要解决此问题,请执行以下操作:

conda install sqlite
conda install python=3.9

否则,您可以安装libsqlite 3-dev包并重新编译Python。
因此,从终端:

sudo apt-get 
install libsqlite3-dev

然后,从下载Python的文件夹中:

./configure
make
sudo make install

相关问题