在jupyter notebook 中运行代码的时候发现点击运行,没有任何反应且anconda prompt会闪退jupyter notebook,然后在anconda prompt中显示Bad file descriptor (C:cilzeromg 1602704446950lworklsrclepoll.cpp:100)
通过查阅,发现是因为安装jupyter notebook的时候,会自动安装ipykemel,然后自动安装了高版本的pyzmq(我安装的anaconda pyzmq 23.2.0)可以通过以下方法解决:
进入Anaconda prompt环境(输入以下命令,更换版本)
pip uninstall pyzmq
pip install pyzmq==19.0.2
但是在卸载pyzmq的时候报错:
PermissionError: [WinError 5] 拒绝访问。: 'c:\\programdata\\anaconda3\\lib\\site-packages\\pyzmq-23.2.0.dist-info\\AUTHORS.md'
然后又找了半天,找到了这条PermissionError: [WinError 5] 拒绝访问。解决办法-CSDN博客
跟着博主试了一下,然后在Anaconda prompt下pip uninstall pyzmq总算是成功了
输入pip install pyzmq==19.0.2,又报错:
ERROR: Could not find a version that satisfies the requirement pyzmq==19.0.2 (from versions: none)
ERROR: No matching distribution found for pyzmq==19.0.2
然后看到有人说用conda进行安装解决了问题,于是
conda install pyzmq=19.0.2
又报错了,pyzmq-19.0.2与我的python-3.11,版本不兼容:
UnsatisfiableError: The following specifications were found
to be incompatible with the existing python installation in your environment:
Specifications:
- pyzmq=19.0.2 -> python[version='>=3.6,<3.7.0a0|>=3.7,<3.8.0a0|>=3.8,<3.9.0a0']
随后安装低版本的python-3.8
conda create -n python38 python=3.8
激活python38,安装pyzmq-19.0.2
重新打开Anaconda prompt,安装pyzmq,输入jupyter notebook 就可以运行了