gpt4 book ai didi

python - 我无法修复 "ModuleNotFoundError: No module named ' mysqlite 2'"

转载 作者:行者123 更新时间:2023-12-04 19:30:53 27 4
gpt4 key购买 nike

我在全新的 centos 上安装了 python3.9 和 jupyter notebook,但我收到一条错误消息,提示“缺少 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

最佳答案

很久以前我遇到了python 3.5的问题,我无法运行jupyter notebook。顺便说一句,我在ubuntu上。
解决这个问题:

conda install sqlite
conda install python=3.9
否则你可以安装 libsqlite3-dev 包并重新编译 Python。
所以,从终端:
sudo apt-get 
install libsqlite3-dev
然后,从您下载 Python 的文件夹中:
./configure
make
sudo make install

关于python - 我无法修复 "ModuleNotFoundError: No module named ' mysqlite 2'",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71263382/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com