jupyter notebook: Import error (zmq: Can not launch jupyter notebook)
程序员文章站
2022-06-01 09:26:46
...
点赞发Nature
关注中Science
问题:新装了一个anaconda虚拟环境,进而安装了jupyter notebook组件。但是发现无法从anaconda prompt启动jupyter notebook,报错(cannot connet to kernel balabala)如下:
Traceback (most recent call last):
File "D:\Users\sheep\Anaconda3\envs\fcLCA\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "D:\Users\sheep\Anaconda3\envs\fcLCA\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "D:\Users\sheep\Anaconda3\envs\fcLCA\lib\site-packages\ipykernel_launcher.py", line 15, in <module>
from ipykernel import kernelapp as app
File "D:\Users\sheep\Anaconda3\envs\fcLCA\lib\site-packages\ipykernel\__init__.py", line 2, in <module>
from .connect import *
File "D:\Users\sheep\Anaconda3\envs\fcLCA\lib\site-packages\ipykernel\connect.py", line 18, in <module>
import jupyter_client
File "D:\Users\sheep\Anaconda3\envs\fcLCA\lib\site-packages\jupyter_client\__init__.py", line 4, in <module>
from .connect import *
File "D:\Users\sheep\Anaconda3\envs\fcLCA\lib\site-packages\jupyter_client\connect.py", line 21, in <module>
import zmq
File "D:\Users\sheep\Anaconda3\envs\fcLCA\lib\site-packages\zmq\__init__.py", line 47, in <module>
from zmq import backend
File "D:\Users\sheep\Anaconda3\envs\fcLCA\lib\site-packages\zmq\backend\__init__.py", line 40, in <module>
reraise(*exc_info)
File "D:\Users\sheep\Anaconda3\envs\fcLCA\lib\site-packages\zmq\utils\sixcerpt.py", line 34, in reraise
raise value
File "D:\Users\sheep\Anaconda3\envs\fcLCA\lib\site-packages\zmq\backend\__init__.py", line 27, in <module>
_ns = select_backend(first)
File "D:\Users\sheep\Anaconda3\envs\fcLCA\lib\site-packages\zmq\backend\select.py", line 28, in select_backend
mod = __import__(name, fromlist=public_api)
File "D:\Users\sheep\Anaconda3\envs\fcLCA\lib\site-packages\zmq\backend\cython\__init__.py", line 6, in <module>
from . import (constants, error, message, context,
ImportError: DLL load failed: 找不到指定的模块。
[I 00:24:44.250 NotebookApp] KernelRestarter: restarting kernel (1/5), keep random ports
Traceback (most recent call last):
File "D:\Users\sheep\Anaconda3\envs\fcLCA\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "D:\Users\sheep\Anaconda3\envs\fcLCA\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "D:\Users\sheep\Anaconda3\envs\fcLCA\lib\site-packages\ipykernel_launcher.py", line 15, in <module>
from ipykernel import kernelapp as app
File "D:\Users\sheep\Anaconda3\envs\fcLCA\lib\site-packages\ipykernel\__init__.py", line 2, in <module>
from .connect import *
File "D:\Users\sheep\Anaconda3\envs\fcLCA\lib\site-packages\ipykernel\connect.py", line 18, in <module>
import jupyter_client
File "D:\Users\sheep\Anaconda3\envs\fcLCA\lib\site-packages\jupyter_client\__init__.py", line 4, in <module>
from .connect import *
File "D:\Users\sheep\Anaconda3\envs\fcLCA\lib\site-packages\jupyter_client\connect.py", line 21, in <module>
import zmq
File "D:\Users\sheep\Anaconda3\envs\fcLCA\lib\site-packages\zmq\__init__.py", line 47, in <module>
from zmq import backend
File "D:\Users\sheep\Anaconda3\envs\fcLCA\lib\site-packages\zmq\backend\__init__.py", line 40, in <module>
reraise(*exc_info)
File "D:\Users\sheep\Anaconda3\envs\fcLCA\lib\site-packages\zmq\utils\sixcerpt.py", line 34, in reraise
raise value
File "D:\Users\sheep\Anaconda3\envs\fcLCA\lib\site-packages\zmq\backend\__init__.py", line 27, in <module>
_ns = select_backend(first)
File "D:\Users\sheep\Anaconda3\envs\fcLCA\lib\site-packages\zmq\backend\select.py", line 28, in select_backend
mod = __import__(name, fromlist=public_api)
File "D:\Users\sheep\Anaconda3\envs\fcLCA\lib\site-packages\zmq\backend\cython\__init__.py", line 6, in <module>
from . import (constants, error, message, context,
ImportError: DLL load failed: 找不到指定的模块。
[I 00:24:47.252 NotebookApp] KernelRestarter: restarting kernel (2/5), keep random ports
Traceback (most recent call last):
File "D:\Users\sheep\Anaconda3\envs\fcLCA\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "D:\Users\sheep\Anaconda3\envs\fcLCA\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "D:\Users\sheep\Anaconda3\envs\fcLCA\lib\site-packages\ipykernel_launcher.py", line 15, in <module>
from ipykernel import kernelapp as app
File "D:\Users\sheep\Anaconda3\envs\fcLCA\lib\site-packages\ipykernel\__init__.py", line 2, in <module>
from .connect import *
File "D:\Users\sheep\Anaconda3\envs\fcLCA\lib\site-packages\ipykernel\connect.py", line 18, in <module>
import jupyter_client
File "D:\Users\sheep\Anaconda3\envs\fcLCA\lib\site-packages\jupyter_client\__init__.py", line 4, in <module>
from .connect import *
File "D:\Users\sheep\Anaconda3\envs\fcLCA\lib\site-packages\jupyter_client\connect.py", line 21, in <module>
import zmq
File "D:\Users\sheep\Anaconda3\envs\fcLCA\lib\site-packages\zmq\__init__.py", line 47, in <module>
from zmq import backend
File "D:\Users\sheep\Anaconda3\envs\fcLCA\lib\site-packages\zmq\backend\__init__.py", line 40, in <module>
reraise(*exc_info)
File "D:\Users\sheep\Anaconda3\envs\fcLCA\lib\site-packages\zmq\utils\sixcerpt.py", line 34, in reraise
raise value
File "D:\Users\sheep\Anaconda3\envs\fcLCA\lib\site-packages\zmq\backend\__init__.py", line 27, in <module>
_ns = select_backend(first)
File "D:\Users\sheep\Anaconda3\envs\fcLCA\lib\site-packages\zmq\backend\select.py", line 28, in select_backend
mod = __import__(name, fromlist=public_api)
File "D:\Users\sheep\Anaconda3\envs\fcLCA\lib\site-packages\zmq\backend\cython\__init__.py", line 6, in <module>
from . import (constants, error, message, context,
ImportError: DLL load failed: 找不到指定的模块。
[I 00:24:50.276 NotebookApp] KernelRestarter: restarting kernel (3/5), keep random ports
Traceback (most recent call last):
File "D:\Users\sheep\Anaconda3\envs\fcLCA\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "D:\Users\sheep\Anaconda3\envs\fcLCA\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "D:\Users\sheep\Anaconda3\envs\fcLCA\lib\site-packages\ipykernel_launcher.py", line 15, in <module>
from ipykernel import kernelapp as app
File "D:\Users\sheep\Anaconda3\envs\fcLCA\lib\site-packages\ipykernel\__init__.py", line 2, in <module>
from .connect import *
File "D:\Users\sheep\Anaconda3\envs\fcLCA\lib\site-packages\ipykernel\connect.py", line 18, in <module>
import jupyter_client
File "D:\Users\sheep\Anaconda3\envs\fcLCA\lib\site-packages\jupyter_client\__init__.py", line 4, in <module>
from .connect import *
File "D:\Users\sheep\Anaconda3\envs\fcLCA\lib\site-packages\jupyter_client\connect.py", line 21, in <module>
import zmq
File "D:\Users\sheep\Anaconda3\envs\fcLCA\lib\site-packages\zmq\__init__.py", line 47, in <module>
from zmq import backend
File "D:\Users\sheep\Anaconda3\envs\fcLCA\lib\site-packages\zmq\backend\__init__.py", line 40, in <module>
reraise(*exc_info)
File "D:\Users\sheep\Anaconda3\envs\fcLCA\lib\site-packages\zmq\utils\sixcerpt.py", line 34, in reraise
raise value
File "D:\Users\sheep\Anaconda3\envs\fcLCA\lib\site-packages\zmq\backend\__init__.py", line 27, in <module>
_ns = select_backend(first)
File "D:\Users\sheep\Anaconda3\envs\fcLCA\lib\site-packages\zmq\backend\select.py", line 28, in select_backend
mod = __import__(name, fromlist=public_api)
File "D:\Users\sheep\Anaconda3\envs\fcLCA\lib\site-packages\zmq\backend\cython\__init__.py", line 6, in <module>
from . import (constants, error, message, context,
ImportError: DLL load failed: 找不到指定的模块。
[I 00:24:53.313 NotebookApp] KernelRestarter: restarting kernel (4/5), keep random ports
Traceback (most recent call last):
File "D:\Users\sheep\Anaconda3\envs\fcLCA\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "D:\Users\sheep\Anaconda3\envs\fcLCA\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "D:\Users\sheep\Anaconda3\envs\fcLCA\lib\site-packages\ipykernel_launcher.py", line 15, in <module>
from ipykernel import kernelapp as app
File "D:\Users\sheep\Anaconda3\envs\fcLCA\lib\site-packages\ipykernel\__init__.py", line 2, in <module>
from .connect import *
File "D:\Users\sheep\Anaconda3\envs\fcLCA\lib\site-packages\ipykernel\connect.py", line 18, in <module>
import jupyter_client
File "D:\Users\sheep\Anaconda3\envs\fcLCA\lib\site-packages\jupyter_client\__init__.py", line 4, in <module>
from .connect import *
File "D:\Users\sheep\Anaconda3\envs\fcLCA\lib\site-packages\jupyter_client\connect.py", line 21, in <module>
import zmq
File "D:\Users\sheep\Anaconda3\envs\fcLCA\lib\site-packages\zmq\__init__.py", line 47, in <module>
from zmq import backend
File "D:\Users\sheep\Anaconda3\envs\fcLCA\lib\site-packages\zmq\backend\__init__.py", line 40, in <module>
reraise(*exc_info)
File "D:\Users\sheep\Anaconda3\envs\fcLCA\lib\site-packages\zmq\utils\sixcerpt.py", line 34, in reraise
raise value
File "D:\Users\sheep\Anaconda3\envs\fcLCA\lib\site-packages\zmq\backend\__init__.py", line 27, in <module>
_ns = select_backend(first)
File "D:\Users\sheep\Anaconda3\envs\fcLCA\lib\site-packages\zmq\backend\select.py", line 28, in select_backend
mod = __import__(name, fromlist=public_api)
File "D:\Users\sheep\Anaconda3\envs\fcLCA\lib\site-packages\zmq\backend\cython\__init__.py", line 6, in <module>
from . import (constants, error, message, context,
ImportError: DLL load failed: 找不到指定的模块。
解决办法:
从报错信息看是zmq库的问题,重新安装zmq库:
pip uninstall pyzmq
pip install pyzmq
办法从GitHub获取
上一篇: 可视化Web报表设计器-FastReport Online Designer简介 .net报表设计报表解决方案fastreport
下一篇: CENTOS7错误:Cannot find a valid baseurl for repo: base/7/x86_6
推荐阅读
-
jupyter notebook打开后新建一个python3之后连接不上网呢或者报错error!解决办法
-
Cannot import seaborn in Jupyter notebook
-
在Jupyter Notebook中使用import
-
jupyter notebook: Import error (zmq: Can not launch jupyter notebook)
-
[bug] Jupyter Notebook Kernel Error
-
Jupyter Notebook:kernel error 解决
-
Error executing Jupyter command ‘notebook‘: [Errno 2] No such file or directory
-
jupyter notebook kernel error
-
Jupyter Notebook Kernel Error
-
virtualenv中运行的jupyter notebook,在import pandas时报错,ImportError: No module named 'pandas'