本文最后更新于:2024年5月7日 下午

本文记录Jupyter notebook 启动错误 “sys/un.h” No such file or directory 的解决方案。

错误复现

在运行 jupyter notebook命令时,报错如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
> jupyter notebook
_cffi_ext.c
E:\ProgramData\Anaconda3\lib\site-packages\zmq\backend\cffi\__pycache__\_cffi_ext.c(213): fatal error C1083: 无法打开包 括文件: “sys/un.h”: No such file or directory
Traceback (most recent call last):
File "E:\ProgramData\Anaconda3\Scripts\jupyter-notebook-script.py", line 6, in <module>
from notebook.notebookapp import main
File "E:\ProgramData\Anaconda3\lib\site-packages\notebook\notebookapp.py", line 46, in <module>
from zmq.eventloop import ioloop
File "E:\ProgramData\Anaconda3\lib\site-packages\zmq\__init__.py", line 47, in <module>
from zmq import backend
File "E:\ProgramData\Anaconda3\lib\site-packages\zmq\backend\__init__.py", line 40, in <module>
reraise(*exc_info)
File "E:\ProgramData\Anaconda3\lib\site-packages\zmq\utils\sixcerpt.py", line 34, in reraise
raise value
File "E:\ProgramData\Anaconda3\lib\site-packages\zmq\backend\__init__.py", line 27, in <module>
_ns = select_backend(first)
File "E:\ProgramData\Anaconda3\lib\site-packages\zmq\backend\select.py", line 27, in select_backend
mod = __import__(name, fromlist=public_api)
File "E:\ProgramData\Anaconda3\lib\site-packages\zmq\backend\cython\__init__.py", line 6, in <module>
from . import (constants, error, message, context,
ImportError: DLL load failed: 找不到指定的模块。

解决方案

  • 卸载pyzmq
1
pip uninstall pyzmq
  • 安装pyzmq
1
pip install pyzmq --user
  • 重新启动 jupyter notebook
1
jupyter notebook


文章链接:
https://www.zywvvd.com/notes/coding/python/jupyter-error/jupyter-error/


“觉得不错的话,给点打赏吧 ୧(๑•̀⌄•́๑)૭”

微信二维码

微信支付

支付宝二维码

支付宝支付

Jupyter notebook 启动错误 “sys/un.h” No such file or directory
https://www.zywvvd.com/notes/coding/python/jupyter-error/jupyter-error/
作者
Yiwei Zhang
发布于
2021年2月20日
许可协议