gpt4 book ai didi

python - 尝试运行 jupyter 笔记本时导入错误

转载 作者:行者123 更新时间:2023-12-01 01:17:09 26 4
gpt4 key购买 nike

尝试运行 jupyter 笔记本时发生导入错误

我正在尝试使用 anaconda (git bash 平台)运行 jupyter 笔记本,当我输入 jupyter 笔记本,每次导入都会出错。我尝试在环境中启动它,但发生了同样的错误。

$ jupyter notebook

回溯(最近一次调用最后一次):

File "C:\Users\User\Anaconda3\Scripts\jupyter-notebook-script.py", line 6, in
<module>
from notebook.notebookapp import main
File "C:\Users\User\Anaconda3\lib\site-packages\notebook\notebookapp.py", line 47, in <module>
from zmq.eventloop import ioloop
File "C:\Users\User\Anaconda3\lib\site-packages\zmq\__init__.py", line 47, in <module>
from zmq import backend
File "C:\Users\User\Anaconda3\lib\site-packages\zmq\backend\__init__.py", line 40, in <module>
reraise(*exc_info)
File "C:\Users\User\Anaconda3\lib\site-packages\zmq\utils\sixcerpt.py", line 34, in reraise
raise value
File "C:\Users\User\Anaconda3\lib\site-packages\zmq\backend\__init__.py", line 27, in <module>
_ns = select_backend(first)
File "C:\Users\User\Anaconda3\lib\site-packages\zmq\backend\select.py", line 27, in select_backend
mod = __import__(name, fromlist=public_api)
File "C:\Users\User\Anaconda3\lib\site-packages\zmq\backend\cython\__init__.py", line 6, in <module>
from . import (constants, error, message, context,
ImportError: DLL load failed: The specified module could not be found.

已编辑重新安装pyzmq(我也尝试重新安装conda)后,出现以下错误:

$ jupyter notebook

Traceback (most recent call last): File "C:\Users\User\Anaconda3\lib\site-packages\notebook\services\sessions\sessionmanager.py", line 10, in import sqlite3

File "C:\Users\User\Anaconda3\lib\sqlite3__init__.py", line 23, in from sqlite3.dbapi2 import *

File "C:\Users\User\Anaconda3\lib\sqlite3\dbapi2.py", line 27, in

from _sqlite3 import *

ImportError: DLL load failed: The specified module could not be found.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\User\Anaconda3\Scripts\jupyter-notebook-script.py", line 6, in

from notebook.notebookapp import main

File "C:\Users\User\Anaconda3\lib\site-packages\notebook\notebookapp.py", line 86, in

from .services.sessions.sessionmanager import SessionManager

File "C:\Users\User\Anaconda3\lib\site-packages\notebook\services\sessions\sessionmanager.py", line 13, in

from pysqlite2 import dbapi2 as sqlite3

ModuleNotFoundError: No module named 'pysqlite2'

最佳答案

我找到了similar issue在 GitHub 上打开 zmq。 GitHub用户推荐harsh23tyagi对大多数人来说似乎有效的是运行以下命令:

pip uninstall pyzmq
pip install pyzmq

关于python - 尝试运行 jupyter 笔记本时导入错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54224969/

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