首页 > 解决方案 > Python 停止在 Jupyter StartUp 上工作

问题描述

我从我的 powershell 提示符启动 Jupyterjupyter notebook并且它正确加载,但是当我打开一个新的或现有的笔记本时,内核处于忙碌状态大约 10 秒,然后我收到一个弹出窗口,说 Python 已停止工作。在我的终端中,我得到了Invalid argument (C:\ci\zeromq_1602704446950\work\src\epoll.cpp:100)(见下文)。有什么解决方案让您想不到吗?我尝试过使用不同的环境和卸载/重新安装pyzmq

[I 12:58:16.682 NotebookApp] Serving notebooks from local directory: C:\Users\tobinp
[I 12:58:16.682 NotebookApp] Jupyter Notebook 6.1.6 is running at:
[I 12:58:16.684 NotebookApp] http://localhost:8888/?token=9eee2cc4e598b193ad42fc05ff620a43d0e5f29e885170b3
[I 12:58:16.684 NotebookApp]  or http://127.0.0.1:8888/?token=9eee2cc4e598b193ad42fc05ff620a43d0e5f29e885170b3
[I 12:58:16.685 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 12:58:18.289 NotebookApp]

To access the notebook, open this file in a browser: file:///C:/Users/tobinp/AppData/Roaming/jupyter/runtime/nbserver-18144-open.html Or copy and paste one of these URLs: http://localhost:8888/?token=7xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx6 or http://127.0.0.1:8888/?token=7xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx6
Invalid argument (C:\ci\zeromq_1602704446950\work\src\epoll.cpp:100)

标签: pythonwindowsjupyter-notebookzeromqpyzmq

解决方案


这是我第三次看到这种问题,而且它们都发生在 2021 年 1 月,这似乎对我们所有人来说都是一个大问题。我安装了Windows 10和python环境20多次,包括Windows 10 1909、20H2、python 3.6.8 3.7.9 3.8.6 3.8.7,问题依旧。这个问题困扰了我两个多星期,本来以为是tensorflow问题、CUDA 11.0问题、cuDNN问题、vc++库问题甚至是RTX 30系列GPU的问题。

解决方案: 此错误与您的 pyzmq 库有关。最近,当我为我的新计算机设置一个全新的 python 环境时,它也给我带来了麻烦。我只是通过使用安装jupyterlab(或jupyter notebook)pip install jupyterlab然后就会出现问题。然后,我查看了包的依赖,pyzmq是安装的,因为我安装了jupyterlab(或者jupyter notebook),jupyterlab需要ipykernel,ipykernel需要pyzmq,安装了更高版本的pyzmq。

我所做的对我有用的是pip uninstall pyzmq,然后

降级到低版本pip install pyzmq==19.0.2 这样解决了python内核的crash问题。

避免这个问题的另一种方法是在 Ubuntu 18.04 上安装你的所有环境,这对我有用,它暂时帮助我避免了这个问题。使用 Anaconda 可能会避免这个问题,但是我在 Anaconda 中使用 tensorflow 时遇到了问题,所以最后没有使用 Anaconda。

那么,我的建议是,如果环境对你来说是固定的,备份你的系统,当问题再次出现时恢复系统。

我还发布了一个github问题链接:https ://github.com/zeromq/pyzmq/issues/1505 ,如果你有类似的问题,你可以在那里发布。


推荐阅读