Python停止在Jupyter启动中工作 [英] Python Stopped Working on Jupyter StartUp

查看:111
本文介绍了Python停止在Jupyter启动中工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从Powershell提示符 jupyter笔记本启动Jupyter,它已正确加载,但是当我打开新笔记本或现有笔记本时,内核忙于大约10秒钟,然后弹出说Python已经停止工作了.在我的终端中,我收到无效的参数(C:\ ci \ zeromq_1602704446950 \ work \ src \ epoll.cpp:100)(请参见下文).您有什么解决方案吗?我尝试使用不同的环境并卸载/重新安装 pyzmq .

I start Jupyter from my powershell prompt jupyter notebook and it loads up correctly, but when I open a new or existing notebook, the kernel sits busy for about 10 sec and then I get a pop-up saying Python has stopped working. In my terminal I get Invalid argument (C:\ci\zeromq_1602704446950\work\src\epoll.cpp:100) (see below). Any solutions off the top of your head? I've tried using different environments and uninstalling/reinstalling 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)

推荐答案

这是我第三次看到这种问题,它们都发生在2021年1月,对我们所有人来说似乎都是一个主要问题.我安装Windows 10和python环境超过20次,包括Windows 10 1909、20H2,python 3.6.8 3.7.9 3.8.6 3.8.7,该问题仍然存在.这个问题使我困惑了两个多星期,最初我以为是张量流问题,CUDA 11.0问题,cuDNN问题,vc ++库问题,甚至是RTX 30系列GPU.

This is the third time I saw this kind of issue, and they all happened in January 2021, it seems to be a major issue for all of us. I installed Windows 10 and python environment more than 20 times, including Windows 10 1909, 20H2, python 3.6.8 3.7.9 3.8.6 3.8.7, the problem still exist. This problem confused me for more than two weeks, and I originally thought it was tensorflow problem, CUDA 11.0 problem, cuDNN problem, vc++ library problem or even the RTX 30 series GPU.

解决方案:此错误与您的pyzmq库有关.最近,当我为新计算机设置全新的python环境时,这也给我带来了麻烦.我只是使用 pip install jupyterlab 安装jupyterlab(或jupyter笔记本),然后会出现问题.然后,我检查了软件包的依赖关系,安装了pyzmq,因为我安装了jupyterlab(或jupyter笔记本),jupyterlab需要ipykernel,ipykernel需要pyzmq,并且安装了更高版本的pyzmq.

Solution: This error is related to your pyzmq library. It also troubles to me when I setup a brand new python environment for my new computer, recently. I just install jupyterlab (or jupyter notebook) by using pip install jupyterlab and then the problem will arise. Then, I checked the dependencies of the package, pyzmq is installed because I installed jupyterlab (or jupyter notebook), jupyterlab needs ipykernel, ipykernel needs pyzmq, and a higher version of pyzmq is installed.

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

What I did useful for me is pip uninstall pyzmq,and then

将其降级为较低版本 pip install pyzmq == 19.0.2 这解决了python内核的崩溃问题.

degrade it to a lower version pip install pyzmq==19.0.2 This solves the crash problem of python kernel.

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

Another way to avoid this issue is to install all your environment on Ubuntu 18.04, this works for me, it temporarily helped me to avoid this issue. Using Anaconda may avoid this issue, but I encountered problem using tensorflow in Anaconda, so I did not use Anaconda in the end.

然后,我建议,如果为您固定了环境,请为您的系统备份,并在问题再次出现时还原系统.

Then, I would suggest is that, if the environment is fixed for you, backup for your system, restore the system when the problem arise again.

我还发布了一个github问题链接: https://github.com/zeromq/pyzmq/issues/1505 ,如果您有类似问题,可以在此处发布.

I also posted a github issue link: https://github.com/zeromq/pyzmq/issues/1505, if you have similiar issue, you could post it there.

这篇关于Python停止在Jupyter启动中工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆