Jupyter notebook 启动错误 “sys/un.h” No such file or directory

2022-08-05 12:47:02 浏览数 (1)

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

错误复现

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

代码语言:javascript复制
> jupyter notebook
_cffi_ext.c
E:ProgramDataAnaconda3libsite-packageszmqbackendcffi__pycache___cffi_ext.c(213): fatal error C1083: 无法打开包 括文件: “sys/un.h”: No such file or directory
Traceback (most recent call last):
  File "E:ProgramDataAnaconda3Scriptsjupyter-notebook-script.py", line 6, in <module>
    from notebook.notebookapp import main
  File "E:ProgramDataAnaconda3libsite-packagesnotebooknotebookapp.py", line 46, in <module>
    from zmq.eventloop import ioloop
  File "E:ProgramDataAnaconda3libsite-packageszmq__init__.py", line 47, in <module>
    from zmq import backend
  File "E:ProgramDataAnaconda3libsite-packageszmqbackend__init__.py", line 40, in <module>
    reraise(*exc_info)
  File "E:ProgramDataAnaconda3libsite-packageszmqutilssixcerpt.py", line 34, in reraise
    raise value
  File "E:ProgramDataAnaconda3libsite-packageszmqbackend__init__.py", line 27, in <module>
    _ns = select_backend(first)
  File "E:ProgramDataAnaconda3libsite-packageszmqbackendselect.py", line 27, in select_backend
    mod = __import__(name, fromlist=public_api)
  File "E:ProgramDataAnaconda3libsite-packageszmqbackendcython__init__.py", line 6, in <module>
    from . import (constants, error, message, context,
ImportError: DLL load failed: 找不到指定的模块。

解决方案

  • 卸载pyzmq
代码语言:javascript复制
pip uninstall pyzmq

  • 安装pyzmq
代码语言:javascript复制
pip install pyzmq --user

  • 重新启动 jupyter notebook
代码语言:javascript复制
jupyter notebook

0 人点赞