【问题标题】:Python Stopped Working on Jupyter StartUpPython 停止在 Jupyter StartUp 上工作
【发布时间】:2021-01-12 19:14:47
【问题描述】:

我从我的 powershell 提示符 jupyter notebook 启动 Jupyter,它可以正确加载,但是当我打开一个新的或现有的笔记本时,内核会忙碌大约 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)

【问题讨论】:

    标签: python windows jupyter-notebook zeromq pyzmq


    【解决方案1】:

    这是我第三次看到这种问题,而且它们都发生在 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 环境时,它也给我带来了麻烦。我只是使用pip install jupyterlab 安装jupyterlab(或jupyter notebook)然后就会出现问题。然后,我查看了包的依赖,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,如果你有类似的问题,可以发在那里。

    【讨论】:

      【解决方案2】:

      我遇到了类似的问题:今天,将 Jupyter 更新到最新版本后,我无法从 Windows Powershell 启动“jupyter notebook”命令,并出现以下回溯:“ImportError: DLL load failed while importing libzmq”。 我用 pyzmq 回滚解决了,从最新版本(21.0.1)到 19.0.2(我以前的版本安装在我的环境中)。

      【讨论】:

        【解决方案3】:

        朋友的笔记本电脑也有同样的问题。她下载了最新版本(Anaconda3-2021.05-Windows-x86_64.exe)安装在 Windows 10 上。尝试启动 jupyter notebook 时,连接到内核(Python3 或 IPykernel)时出现问题。我花了 2 个小时使用 Zoom 远程桌面来处理它,比如更新、检查日志、创建新环境和删除并重新安装。在我遇到降低 Pyzmq 版本的想法之前,没有好消息。解决问题的方法简单快捷,总结如下:

        1. 步骤 1 打开 Anaconda Prompt(无需以管理员身份运行)
        2. 第二步卸载pyzmq:pip uninstall pyzmq
        3. 第 3 步安装所需版本:pip install pyzmq==19.0.2

        当我在我的 PC 上移除 Anaconda 3(几年前安装)并重新安装最新版本时,这已经够奇怪了。连接内核没问题!

        【讨论】:

          猜你喜欢
          • 2017-08-18
          • 1970-01-01
          • 2020-10-31
          • 2011-02-03
          • 2017-07-10
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多