# Jupyter Notebook 'zmq message arrived on closed channel' Error

**URL:** <https://discourse.jupyter.org/t/jupyter-notebook-zmq-message-arrived-on-closed-channel-error/17869>\
**Category:** Notebook\
**Created:** [February 6, 2023, 7:32pm UTC](https://discourse.jupyter.org/t/jupyter-notebook-zmq-message-arrived-on-closed-channel-error/17869 "2023-02-06T19:32:57Z")\
**Posts on this page:** 9\
**Page:** 2

<div class="post-metadata">

**Author:** ![bheberlein](https://avatars.discourse-cdn.com/v4/letter/b/b2d939/32.png) [@bheberlein](https://discourse.jupyter.org/u/bheberlein)\
**Post date:** [March 21, 2023, 2:07pm UTC](https://discourse.jupyter.org/t/jupyter-notebook-zmq-message-arrived-on-closed-channel-error/17869/22 "2023-03-21T14:07:35Z")

</div>

I am also experiencing this on my M1 Mac with jupyter\_client 8.0.3 and tornado 6.2. Downgrading to tornado 6.1 seems to have fixed it.

---

<div class="post-metadata">

**Author:** ![Andrew\_Martin](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/andrew_martin/32/9478_2.png) [@Andrew\_Martin](https://discourse.jupyter.org/u/Andrew_Martin)\
**Post date:** [March 26, 2023, 3:24pm UTC](https://discourse.jupyter.org/t/jupyter-notebook-zmq-message-arrived-on-closed-channel-error/17869/23 "2023-03-26T15:24:40Z")

</div>

I had the same issue with %matplotlib notebook. Using %matplotlib inline (or others) resolved the issue. Reverting to tornado==6.1 did not work for me.

---

<div class="post-metadata">

**Author:** ![lalkelalke04](https://avatars.discourse-cdn.com/v4/letter/l/49beb7/32.png) [@lalkelalke04](https://discourse.jupyter.org/u/lalkelalke04)\
**Post date:** [March 27, 2023, 7:02pm UTC](https://discourse.jupyter.org/t/jupyter-notebook-zmq-message-arrived-on-closed-channel-error/17869/24 "2023-03-27T19:02:06Z")

</div>

Same problem as everyone else. I did install jupyterlab, in addition to jupyter, but it made no difference.

---

<div class="post-metadata">

**Author:** ![Mustapha-AJEGHRIR](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/mustapha-ajeghrir/32/9498_2.png) [@Mustapha-AJEGHRIR](https://discourse.jupyter.org/u/Mustapha-AJEGHRIR)\
**Post date:** [March 28, 2023, 12:30pm UTC](https://discourse.jupyter.org/t/jupyter-notebook-zmq-message-arrived-on-closed-channel-error/17869/25 "2023-03-28T12:30:27Z")

</div>

I had same problem. After investigation, I found the following warning in the beginning of the logs of my vscode jupyter notebook :

```auto
warn 13:04:52.769: Exception while attempting zmq : /snap/core/current/usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.22' not found (required by /home/mustapha/.vscode/extensions/ms-toolsai.jupyter-2023.2.1200692131/out/node_modules/zeromq/prebuilds/linux-x64/electron.napi.glibc.node)

```

I solved the problem sofar by installing ZMQ with `apt` : `apt-get install libzmq3-dev` and uninstalling vscode from snap and install it with apt like here [https://code.visualstudio.com/docs/setup/linux](https://code.visualstudio.com/docs/setup/linux) . The snap libstdc++.so.6 package doesn’t contain last version of GLIBCXX even after update.

So far, I don’t get the warning above and all runs correctly

---

<div class="post-metadata">

**Author:** ![vasily](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/vasily/32/9758_2.png) [@vasily](https://discourse.jupyter.org/u/vasily)\
**Post date:** [April 27, 2023, 12:39pm UTC](https://discourse.jupyter.org/t/jupyter-notebook-zmq-message-arrived-on-closed-channel-error/17869/27 "2023-04-27T12:39:55Z")

</div>

> <https://github.com/jupyter/notebook/issues/6721#issuecomment-1445187389>
>
> \*\*Describe the bug\*\*
> Hello!
> 
> I’ve recently begun to experience near constant …zmq/tornado errors when running Jupyter notebook from my conda environment (Jupyter, conda env, and traceback details below). When the error occurs, code cells in the Jupyter Notebook fail to either run entirely and/or the cells run but the output does not get printed to the Notebook.
> 
> The same error also occurs while using JupyterLab but seemingly less frequently. On occasion, Jupyter will run for several hours without exhibiting the issue while in other instances the error starts occurring immediately after a Notebook is started.
> 
> I would really appreciate any suggestions for resolving the issue. Thanks so much!
> 
> \*\*To Reproduce\*\*
> 1. Activate conda env
> 2. Start jupyter notebook by calling \`jupyter-notebook\` in bash
> 3. Open an .ipynb notebook and (preferably) run multiple cells at once using either 'Run All' or 'Run All Above'
> 4. If the error traceback (copied below) does not appear immediately, it will arise after the Notebook is used for a few minutes. 
> 
> \*\*Expected behavior\*\*
> Connection to the notebook is maintained and output of stdout is printed/redirected to the notebook
> 
> \*\*Desktop (please complete the following information):\*\*
> 
> macOS v12.6.3
> Firefox v109.0.1
> 
> \*\*Additional context\*\*
> 
> Output of \`jupyer --version\`
> 
> IPython : 8.9.0  
> ipykernel : 6.21.1  
> ipywidgets : 8.0.4
> jupyter\_client : 8.0.2
> jupyter\_core : 5.2.0
> jupyter\_server : 2.2.1
> jupyterlab : 3.5.3
> nbclient : 0.7.2
> nbconvert : 7.2.9
> nbformat : 5.7.3
> notebook : 6.5.2
> qtconsole : 5.4.0
> traitlets : 5.9.0
> 
> Output of \`conda --list\`
> 
> anyio 3.6.2 pyhd8ed1ab\_0 conda-forge
> appdirs 1.4.4 pyh9f0ad1d\_0 conda-forge
> appnope 0.1.3 pyhd8ed1ab\_0 conda-forge
> argon2-cffi 21.3.0 pyhd8ed1ab\_0 conda-forge
> argon2-cffi-bindings 21.2.0 py311h5547dcb\_3 conda-forge
> arrow-cpp 11.0.0 h694c41f\_2\_cpu conda-forge
> asttokens 2.2.1 pyhd8ed1ab\_0 conda-forge
> attrs 22.2.0 pyh71513ae\_0 conda-forge
> aws-c-auth 0.6.23 hb2f45f0\_1 conda-forge
> aws-c-cal 0.5.20 h3aaaed9\_4 conda-forge
> aws-c-common 0.8.9 hb7f2c08\_0 conda-forge
> aws-c-compression 0.2.16 h980c674\_1 conda-forge
> aws-c-event-stream 0.2.18 h947c3fe\_2 conda-forge
> aws-c-http 0.7.3 h9091ec1\_1 conda-forge
> aws-c-io 0.13.14 h666a9c8\_3 conda-forge
> aws-c-mqtt 0.8.6 h2814666\_1 conda-forge
> aws-c-s3 0.2.3 h24f324c\_3 conda-forge
> aws-c-sdkutils 0.1.7 h980c674\_1 conda-forge
> aws-checksums 0.1.14 h980c674\_1 conda-forge
> aws-crt-cpp 0.18.16 ha2465d3\_13 conda-forge
> aws-sdk-cpp 1.10.57 hcf18aa8\_2 conda-forge
> babel 2.11.0 pyhd8ed1ab\_0 conda-forge
> backcall 0.2.0 pyh9f0ad1d\_0 conda-forge
> backports 1.0 pyhd8ed1ab\_3 conda-forge
> backports.functools\_lru\_cache 1.6.4 pyhd8ed1ab\_0 conda-forge
> beautifulsoup4 4.11.2 pyha770c72\_0 conda-forge
> bleach 6.0.0 pyhd8ed1ab\_0 conda-forge
> blosc 1.21.2 hebb52c4\_0 conda-forge
> brotli 1.0.9 hb7f2c08\_8 conda-forge
> brotli-bin 1.0.9 hb7f2c08\_8 conda-forge
> brotlipy 0.7.0 py311h5547dcb\_1005 conda-forge
> bzip2 1.0.8 h0d85af4\_4 conda-forge
> c-ares 1.18.1 h0d85af4\_0 conda-forge
> ca-certificates 2022.12.7 h033912b\_0 conda-forge
> cached-property 1.5.2 hd8ed1ab\_1 conda-forge
> cached\_property 1.5.2 pyha770c72\_1 conda-forge
> certifi 2022.12.7 pyhd8ed1ab\_0 conda-forge
> cffi 1.15.1 py311ha86e640\_3 conda-forge
> charset-normalizer 2.1.1 pyhd8ed1ab\_0 conda-forge
> colorama 0.4.6 pyhd8ed1ab\_0 conda-forge
> comm 0.1.2 pyhd8ed1ab\_0 conda-forge
> contourpy 1.0.7 py311hd2070f0\_0 conda-forge
> cryptography 39.0.0 py311h61927ef\_0 conda-forge
> curl 7.87.0 h6df9250\_0 conda-forge
> cycler 0.11.0 pyhd8ed1ab\_0 conda-forge
> debugpy 1.6.6 py311h814d153\_0 conda-forge
> decorator 5.1.1 pyhd8ed1ab\_0 conda-forge
> defusedxml 0.7.1 pyhd8ed1ab\_0 conda-forge
> entrypoints 0.4 pyhd8ed1ab\_0 conda-forge
> executing 1.2.0 pyhd8ed1ab\_0 conda-forge
> expat 2.5.0 hf0c8a7f\_0 conda-forge
> flit-core 3.8.0 pyhd8ed1ab\_0 conda-forge
> fonttools 4.38.0 py311h5547dcb\_1 conda-forge
> freetype 2.12.1 h3f81eb7\_1 conda-forge
> future 0.18.3 pyhd8ed1ab\_0 conda-forge
> gettext 0.21.1 h8a4c099\_0 conda-forge
> gflags 2.2.2 hb1e8313\_1004 conda-forge
> git 2.39.1 pl5321h0195497\_0 conda-forge
> glib 2.74.1 hbc0c0cd\_1 conda-forge
> glib-tools 2.74.1 hbc0c0cd\_1 conda-forge
> glog 0.6.0 h8ac2a54\_0 conda-forge
> gst-plugins-base 1.21.3 h37e1711\_1 conda-forge
> gstreamer 1.21.3 h1d18e73\_1 conda-forge
> h5py 3.8.0 nompi\_py311h777de7a\_100 conda-forge
> hdf5 1.12.2 nompi\_h48135f9\_101 conda-forge
> icu 70.1 h96cf925\_0 conda-forge
> idna 3.4 pyhd8ed1ab\_0 conda-forge
> importlib-metadata 6.0.0 pyha770c72\_0 conda-forge
> importlib\_metadata 6.0.0 hd8ed1ab\_0 conda-forge
> importlib\_resources 5.10.2 pyhd8ed1ab\_0 conda-forge
> ipykernel 6.21.1 pyh736e0ef\_0 conda-forge
> ipython 8.9.0 pyhd1c38e8\_0 conda-forge
> ipython\_genutils 0.2.0 py\_1 conda-forge
> ipywidgets 8.0.4 pyhd8ed1ab\_0 conda-forge
> jedi 0.18.2 pyhd8ed1ab\_0 conda-forge
> jinja2 3.1.2 pyhd8ed1ab\_1 conda-forge
> joblib 1.2.0 pyhd8ed1ab\_0 conda-forge
> jpeg 9e hac89ed1\_2 conda-forge
> json5 0.9.5 pyh9f0ad1d\_0 conda-forge
> jsonschema 4.17.3 pyhd8ed1ab\_0 conda-forge
> jupyter 1.0.0 py311h6eed73b\_8 conda-forge
> jupyter\_client 8.0.2 pyhd8ed1ab\_0 conda-forge
> jupyter\_console 6.4.4 pyhd8ed1ab\_0 conda-forge
> jupyter\_core 5.2.0 py311h6eed73b\_0 conda-forge
> jupyter\_events 0.6.3 pyhd8ed1ab\_0 conda-forge
> jupyter\_server 2.2.1 pyhd8ed1ab\_0 conda-forge
> jupyter\_server\_terminals 0.4.4 pyhd8ed1ab\_1 conda-forge
> jupyterlab 3.5.3 pyhd8ed1ab\_0 conda-forge
> jupyterlab\_pygments 0.2.2 pyhd8ed1ab\_0 conda-forge
> jupyterlab\_server 2.19.0 pyhd8ed1ab\_0 conda-forge
> jupyterlab\_widgets 3.0.5 pyhd8ed1ab\_0 conda-forge
> kiwisolver 1.4.4 py311hd2070f0\_1 conda-forge
> krb5 1.20.1 h049b76e\_0 conda-forge
> lcms2 2.14 h29502cd\_1 conda-forge
> lerc 4.0.0 hb486fe8\_0 conda-forge
> libabseil 20220623.0 cxx17\_h844d122\_6 conda-forge
> libaec 1.0.6 hf0c8a7f\_1 conda-forge
> libarrow 11.0.0 hf6017ac\_2\_cpu conda-forge
> libblas 3.9.0 16\_osx64\_openblas conda-forge
> libbrotlicommon 1.0.9 hb7f2c08\_8 conda-forge
> libbrotlidec 1.0.9 hb7f2c08\_8 conda-forge
> libbrotlienc 1.0.9 hb7f2c08\_8 conda-forge
> libcblas 3.9.0 16\_osx64\_openblas conda-forge
> libclang 13.0.1 default\_he082bbe\_0 conda-forge
> libcrc32c 1.1.2 he49afe7\_0 conda-forge
> libcurl 7.87.0 h6df9250\_0 conda-forge
> libcxx 14.0.6 hccf4f1f\_0 conda-forge
> libdeflate 1.17 hac1461d\_0 conda-forge
> libedit 3.1.20191231 h0678c8f\_2 conda-forge
> libev 4.33 haf1e3a3\_1 conda-forge
> libevent 2.1.10 h7d65743\_4 conda-forge
> libffi 3.4.2 h0d85af4\_5 conda-forge
> libgfortran 5.0.0 11\_3\_0\_h97931a8\_27 conda-forge
> libgfortran5 11.3.0 h082f757\_27 conda-forge
> libglib 2.74.1 h4c723e1\_1 conda-forge
> libgoogle-cloud 2.7.0 hb5e37a9\_0 conda-forge
> libgrpc 1.51.1 h1ddfa78\_1 conda-forge
> libiconv 1.17 hac89ed1\_0 conda-forge
> liblapack 3.9.0 16\_osx64\_openblas conda-forge
> libllvm13 13.0.1 h64f94b2\_2 conda-forge
> libnghttp2 1.51.0 he2ab024\_0 conda-forge
> libogg 1.3.4 h35c211d\_1 conda-forge
> libopenblas 0.3.21 openmp\_h429af6e\_3 conda-forge
> libopus 1.3.1 hc929b4f\_1 conda-forge
> libpng 1.6.39 ha978bb4\_0 conda-forge
> libpq 15.1 h3640bf0\_3 conda-forge
> libprotobuf 3.21.12 hbc0c0cd\_0 conda-forge
> libsodium 1.0.18 hbcb3906\_1 conda-forge
> libsqlite 3.40.0 ha978bb4\_0 conda-forge
> libssh2 1.10.0 h47af595\_3 conda-forge
> libthrift 0.16.0 h16802d8\_2 conda-forge
> libtiff 4.5.0 hee9004a\_2 conda-forge
> libutf8proc 2.8.0 hb7f2c08\_0 conda-forge
> libvorbis 1.3.7 h046ec9c\_0 conda-forge
> libwebp-base 1.2.4 h775f41a\_0 conda-forge
> libxcb 1.13 h0d85af4\_1004 conda-forge
> libzlib 1.2.13 hfd90126\_4 conda-forge
> llvm-openmp 15.0.7 h61d9ccf\_0 conda-forge
> lz4-c 1.9.4 hf0c8a7f\_0 conda-forge
> markupsafe 2.1.2 py311h5547dcb\_0 conda-forge
> matplotlib 3.6.3 py311h6eed73b\_0 conda-forge
> matplotlib-base 3.6.3 py311h2bf763f\_0 conda-forge
> matplotlib-inline 0.1.6 pyhd8ed1ab\_0 conda-forge
> mistune 2.0.4 pyhd8ed1ab\_0 conda-forge
> munkres 1.1.4 pyh9f0ad1d\_0 conda-forge
> mysql-common 8.0.31 hc4b2c72\_0 conda-forge
> mysql-libs 8.0.31 h8658499\_0 conda-forge
> nbclassic 0.5.1 pyhd8ed1ab\_0 conda-forge
> nbclient 0.7.2 pyhd8ed1ab\_0 conda-forge
> nbconvert 7.2.9 pyhd8ed1ab\_0 conda-forge
> nbconvert-core 7.2.9 pyhd8ed1ab\_0 conda-forge
> nbconvert-pandoc 7.2.9 pyhd8ed1ab\_0 conda-forge
> nbformat 5.7.3 pyhd8ed1ab\_0 conda-forge
> ncurses 6.3 h96cf925\_1 conda-forge
> nest-asyncio 1.5.6 pyhd8ed1ab\_0 conda-forge
> notebook 6.5.2 pyha770c72\_1 conda-forge
> notebook-shim 0.2.2 pyhd8ed1ab\_0 conda-forge
> nspr 4.35 hea0b92c\_0 conda-forge
> nss 3.78 ha8197d3\_0 conda-forge
> numexpr 2.8.3 py311hd84f3f5\_1 conda-forge
> numpy 1.24.2 py311ha9d2c9f\_0 conda-forge
> openjpeg 2.5.0 h13ac156\_2 conda-forge
> openssl 3.0.7 hfd90126\_2 conda-forge
> orc 1.8.2 ha9d861c\_2 conda-forge
> packaging 23.0 pyhd8ed1ab\_0 conda-forge
> pandas 1.5.3 py311hd84f3f5\_0 conda-forge
> pandoc 2.19.2 h694c41f\_1 conda-forge
> pandocfilters 1.5.0 pyhd8ed1ab\_0 conda-forge
> parquet-cpp 1.5.1 2 conda-forge
> parso 0.8.3 pyhd8ed1ab\_0 conda-forge
> patsy 0.5.3 pyhd8ed1ab\_0 conda-forge
> pcre2 10.40 h1c4e4bc\_0 conda-forge
> perl 5.32.1 2\_h0d85af4\_perl5 conda-forge
> pexpect 4.8.0 pyh1a96a4e\_2 conda-forge
> pickleshare 0.7.5 py\_1003 conda-forge
> pillow 9.4.0 py311h5bae705\_1 conda-forge
> pip 23.0 pyhd8ed1ab\_0 conda-forge
> pkgutil-resolve-name 1.3.10 pyhd8ed1ab\_0 conda-forge
> platformdirs 2.6.2 pyhd8ed1ab\_0 conda-forge
> ply 3.11 py\_1 conda-forge
> pooch 1.6.0 pyhd8ed1ab\_0 conda-forge
> prometheus\_client 0.16.0 pyhd8ed1ab\_0 conda-forge
> prompt-toolkit 3.0.36 pyha770c72\_0 conda-forge
> prompt\_toolkit 3.0.36 hd8ed1ab\_0 conda-forge
> psutil 5.9.4 py311h5547dcb\_0 conda-forge
> pthread-stubs 0.4 hc929b4f\_1001 conda-forge
> ptyprocess 0.7.0 pyhd3deb0d\_0 conda-forge
> pure\_eval 0.2.2 pyhd8ed1ab\_0 conda-forge
> pyarrow 11.0.0 py311hb17b21d\_2\_cpu conda-forge
> pycparser 2.21 pyhd8ed1ab\_0 conda-forge
> pygments 2.14.0 pyhd8ed1ab\_0 conda-forge
> pymatreader 0.0.30 pyhd8ed1ab\_0 conda-forge
> pyopenssl 23.0.0 pyhd8ed1ab\_0 conda-forge
> pyparsing 3.0.9 pyhd8ed1ab\_0 conda-forge
> pyqt 5.15.7 py311h8771221\_3 conda-forge
> pyqt5-sip 12.11.0 py311h78fa98d\_3 conda-forge
> pyrsistent 0.19.3 py311h5547dcb\_0 conda-forge
> pysocks 1.7.1 pyha2e5f31\_6 conda-forge
> pytables 3.7.0 py311ha9b306f\_3 conda-forge
> python 3.11.0 he7542f4\_1\_cpython conda-forge
> python-dateutil 2.8.2 pyhd8ed1ab\_0 conda-forge
> python-fastjsonschema 2.16.2 pyhd8ed1ab\_0 conda-forge
> python-json-logger 2.0.4 pyhd8ed1ab\_0 conda-forge
> python\_abi 3.11 3\_cp311 conda-forge
> pytz 2022.7.1 pyhd8ed1ab\_0 conda-forge
> pyyaml 6.0 py311h5547dcb\_5 conda-forge
> pyzmq 25.0.0 py311habfacb3\_0 conda-forge
> qt-main 5.15.6 haeff654\_6 conda-forge
> qtconsole 5.4.0 pyhd8ed1ab\_0 conda-forge
> qtconsole-base 5.4.0 pyha770c72\_0 conda-forge
> qtpy 2.3.0 pyhd8ed1ab\_0 conda-forge
> re2 2023.02.01 hf0c8a7f\_0 conda-forge
> readline 8.1.2 h3899abd\_0 conda-forge
> requests 2.28.2 pyhd8ed1ab\_0 conda-forge
> rfc3339-validator 0.1.4 pyhd8ed1ab\_0 conda-forge
> rfc3986-validator 0.1.1 pyh9f0ad1d\_0 conda-forge
> scikit-learn 1.2.1 py311h087fafe\_0 conda-forge
> scipy 1.10.0 py311h939689b\_2 conda-forge
> seaborn 0.12.2 hd8ed1ab\_0 conda-forge
> seaborn-base 0.12.2 pyhd8ed1ab\_0 conda-forge
> send2trash 1.8.0 pyhd8ed1ab\_0 conda-forge
> setuptools 67.1.0 pyhd8ed1ab\_0 conda-forge
> sip 6.7.7 py311h814d153\_0 conda-forge
> six 1.16.0 pyh6c4a22f\_0 conda-forge
> snappy 1.1.9 h225ccf5\_2 conda-forge
> sniffio 1.3.0 pyhd8ed1ab\_0 conda-forge
> soupsieve 2.3.2.post1 pyhd8ed1ab\_0 conda-forge
> sqlite 3.40.0 h9ae0607\_0 conda-forge
> stack\_data 0.6.2 pyhd8ed1ab\_0 conda-forge
> statsmodels 0.13.5 py311hd5badaa\_2 conda-forge
> terminado 0.17.1 pyhd1c38e8\_0 conda-forge
> threadpoolctl 3.1.0 pyh8a188c0\_0 conda-forge
> tinycss2 1.2.1 pyhd8ed1ab\_0 conda-forge
> tk 8.6.12 h5dbffcc\_0 conda-forge
> toml 0.10.2 pyhd8ed1ab\_0 conda-forge
> tomli 2.0.1 pyhd8ed1ab\_0 conda-forge
> tornado 6.2 py311h5547dcb\_1 conda-forge
> tqdm 4.64.1 pyhd8ed1ab\_0 conda-forge
> traitlets 5.9.0 pyhd8ed1ab\_0 conda-forge
> typing-extensions 4.4.0 hd8ed1ab\_0 conda-forge
> typing\_extensions 4.4.0 pyha770c72\_0 conda-forge
> tzdata 2022g h191b570\_0 conda-forge
> urllib3 1.26.14 pyhd8ed1ab\_0 conda-forge
> wcwidth 0.2.6 pyhd8ed1ab\_0 conda-forge
> webencodings 0.5.1 py\_1 conda-forge
> websocket-client 1.5.1 pyhd8ed1ab\_0 conda-forge
> wheel 0.38.4 pyhd8ed1ab\_0 conda-forge
> widgetsnbextension 4.0.5 pyhd8ed1ab\_0 conda-forge
> xmltodict 0.13.0 pyhd8ed1ab\_0 conda-forge
> xorg-libxau 1.0.9 h35c211d\_0 conda-forge
> xorg-libxdmcp 1.1.3 h35c211d\_0 conda-forge
> xz 5.2.6 h775f41a\_0 conda-forge
> yaml 0.2.5 h0d85af4\_2 conda-forge
> zeromq 4.3.4 he49afe7\_1 conda-forge
> zipp 3.12.1 pyhd8ed1ab\_0 conda-forge
> zlib 1.2.13 hfd90126\_4 conda-forge
> zstd 1.5.2 hbc0c0cd\_6 conda-forge
> 
> Error printed to Jupyter’s console:
> 
> \[W TIMESTAMP NotebookApp\] zmq message arrived on closed channel
> 
> Python traceback:
> 
> \[E 09:29:38.352 NotebookApp\] Uncaught exception in ZMQStream callback
> Traceback (most recent call last):
> File "/Users/data/miniconda3/envs/da/lib/python3.11/site-packages/zmq/eventloop/zmqstream.py", line 584, in \_run\_callback
> f = callback(\*args, \*\*kwargs)
> ^^^^^^^^^^^^^^^^^^^^^^^^^
> File "/Users/data/miniconda3/envs/da/lib/python3.11/site-packages/zmq/eventloop/zmqstream.py", line 308, in stream\_callback
> return callback(self, msg)
> ^^^^^^^^^^^^^^^^^^^
> File "/Users/data/miniconda3/envs/da/lib/python3.11/site-packages/notebook/services/kernels/handlers.py", line 572, in \_on\_zmq\_reply
> super().\_on\_zmq\_reply(stream, msg)
> File "/Users/data/miniconda3/envs/da/lib/python3.11/site-packages/notebook/base/zmqhandlers.py", line 256, in \_on\_zmq\_reply
> self.write\_message(msg, binary=isinstance(msg, bytes))
> File "/Users/data/miniconda3/envs/da/lib/python3.11/site-packages/tornado/websocket.py", line 339, in write\_message
> return self.ws\_connection.write\_message(message, binary=binary)
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> File "/Users/data/miniconda3/envs/da/lib/python3.11/site-packages/tornado/websocket.py", line 1086, in write\_message
> fut = self.\_write\_frame(True, opcode, message, flags=flags)
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> File "/Users/data/miniconda3/envs/da/lib/python3.11/site-packages/tornado/websocket.py", line 1061, in \_write\_frame
> return self.stream.write(frame)
> ^^^^^^^^^^^^^^^^^^^^^^^^
> File "/Users/data/miniconda3/envs/da/lib/python3.11/site-packages/tornado/iostream.py", line 546, in write
> self.\_handle\_write()
> File "/Users/data/miniconda3/envs/da/lib/python3.11/site-packages/tornado/iostream.py", line 976, in \_handle\_write
> self.\_write\_buffer.advance(num\_bytes)
> File "/Users/data/miniconda3/envs/da/lib/python3.11/site-packages/tornado/iostream.py", line 182, in advance
> assert 0 \< size \<= self.\_size
> AssertionError
> \[E 09:29:38.357 NotebookApp\] Uncaught exception in zmqstream callback
> Traceback (most recent call last):
> File "/Users/data/miniconda3/envs/da/lib/python3.11/site-packages/zmq/eventloop/zmqstream.py", line 621, in \_handle\_events
> self.\_handle\_recv()
> File "/Users/data/miniconda3/envs/da/lib/python3.11/site-packages/zmq/eventloop/zmqstream.py", line 650, in \_handle\_recv
> self.\_run\_callback(callback, msg)
> File "/Users/data/miniconda3/envs/da/lib/python3.11/site-packages/zmq/eventloop/zmqstream.py", line 584, in \_run\_callback
> f = callback(\*args, \*\*kwargs)
> ^^^^^^^^^^^^^^^^^^^^^^^^^
> File "/Users/data/miniconda3/envs/da/lib/python3.11/site-packages/zmq/eventloop/zmqstream.py", line 308, in stream\_callback
> return callback(self, msg)
> ^^^^^^^^^^^^^^^^^^^
> File "/Users/data/miniconda3/envs/da/lib/python3.11/site-packages/notebook/services/kernels/handlers.py", line 572, in \_on\_zmq\_reply
> super().\_on\_zmq\_reply(stream, msg)
> File "/Users/data/miniconda3/envs/da/lib/python3.11/site-packages/notebook/base/zmqhandlers.py", line 256, in \_on\_zmq\_reply
> self.write\_message(msg, binary=isinstance(msg, bytes))
> File "/Users/data/miniconda3/envs/da/lib/python3.11/site-packages/tornado/websocket.py", line 339, in write\_message
> return self.ws\_connection.write\_message(message, binary=binary)
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> File "/Users/data/miniconda3/envs/da/lib/python3.11/site-packages/tornado/websocket.py", line 1086, in write\_message
> fut = self.\_write\_frame(True, opcode, message, flags=flags)
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> File "/Users/data/miniconda3/envs/da/lib/python3.11/site-packages/tornado/websocket.py", line 1061, in \_write\_frame
> return self.stream.write(frame)
> ^^^^^^^^^^^^^^^^^^^^^^^^
> File "/Users/data/miniconda3/envs/da/lib/python3.11/site-packages/tornado/iostream.py", line 546, in write
> self.\_handle\_write()
> File "/Users/data/miniconda3/envs/da/lib/python3.11/site-packages/tornado/iostream.py", line 976, in \_handle\_write
> self.\_write\_buffer.advance(num\_bytes)
> File "/Users/data/miniconda3/envs/da/lib/python3.11/site-packages/tornado/iostream.py", line 182, in advance
> assert 0 \< size \<= self.\_size
> AssertionError
> \[E 09:29:38.358 NotebookApp\] Exception in callback functools.partial(\<function ZMQStream.\_update\_handler.\<locals\>.\<lambda\> at 0x1086751c0\>)
> Traceback (most recent call last):
> File "/Users/data/miniconda3/envs/da/lib/python3.11/site-packages/tornado/ioloop.py", line 740, in \_run\_callback
> ret = callback()
> ^^^^^^^^^^
> File "/Users/data/miniconda3/envs/da/lib/python3.11/site-packages/zmq/eventloop/zmqstream.py", line 705, in \<lambda\>
> self.io\_loop.add\_callback(lambda: self.\_handle\_events(self.socket, 0))
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> File "/Users/data/miniconda3/envs/da/lib/python3.11/site-packages/zmq/eventloop/zmqstream.py", line 621, in \_handle\_events
> self.\_handle\_recv()
> File "/Users/data/miniconda3/envs/da/lib/python3.11/site-packages/zmq/eventloop/zmqstream.py", line 650, in \_handle\_recv
> self.\_run\_callback(callback, msg)
> File "/Users/data/miniconda3/envs/da/lib/python3.11/site-packages/zmq/eventloop/zmqstream.py", line 584, in \_run\_callback
> f = callback(\*args, \*\*kwargs)
> ^^^^^^^^^^^^^^^^^^^^^^^^^
> File "/Users/data/miniconda3/envs/da/lib/python3.11/site-packages/zmq/eventloop/zmqstream.py", line 308, in stream\_callback
> return callback(self, msg)
> ^^^^^^^^^^^^^^^^^^^
> File "/Users/data/miniconda3/envs/da/lib/python3.11/site-packages/notebook/services/kernels/handlers.py", line 572, in \_on\_zmq\_reply
> super().\_on\_zmq\_reply(stream, msg)
> File "/Users/data/miniconda3/envs/da/lib/python3.11/site-packages/notebook/base/zmqhandlers.py", line 256, in \_on\_zmq\_reply
> self.write\_message(msg, binary=isinstance(msg, bytes))
> File "/Users/data/miniconda3/envs/da/lib/python3.11/site-packages/tornado/websocket.py", line 339, in write\_message
> return self.ws\_connection.write\_message(message, binary=binary)
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> File "/Users/data/miniconda3/envs/da/lib/python3.11/site-packages/tornado/websocket.py", line 1086, in write\_message
> fut = self.\_write\_frame(True, opcode, message, flags=flags)
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> File "/Users/data/miniconda3/envs/da/lib/python3.11/site-packages/tornado/websocket.py", line 1061, in \_write\_frame
> return self.stream.write(frame)
> ^^^^^^^^^^^^^^^^^^^^^^^^
> File "/Users/data/miniconda3/envs/da/lib/python3.11/site-packages/tornado/iostream.py", line 546, in write
> self.\_handle\_write()
> File "/Users/data/miniconda3/envs/da/lib/python3.11/site-packages/tornado/iostream.py", line 976, in \_handle\_write
> self.\_write\_buffer.advance(num\_bytes)
> File "/Users/data/miniconda3/envs/da/lib/python3.11/site-packages/tornado/iostream.py", line 182, in advance
> assert 0 \< size \<= self.\_size
> AssertionError

This bit solved it for me:

```auto
pip install --upgrade "pyzmq<25" "jupyter_client<8"

```

---

<div class="post-metadata">

**Author:** ![smacke](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/smacke/32/8937_2.png) [@smacke](https://discourse.jupyter.org/u/smacke)\
**Post date:** [May 22, 2023, 8:51pm UTC](https://discourse.jupyter.org/t/jupyter-notebook-zmq-message-arrived-on-closed-channel-error/17869/28 "2023-05-22T20:51:51Z")

</div>

I ran into this issue during development of a reactive Python kernel I work on called [ipyflow](https://github.com/ipyflow/ipyflow). I did some digging here, and at least for me, it seems like this bug was introduced when the utility function `run_sync` was rewritten to no longer use `nest_asyncio`: [Jupyter Notebook ‘zmq message arrived on closed channel’ Error · Issue #6721 · jupyter/notebook · GitHub](https://github.com/jupyter/notebook/issues/6721)

The `run_sync` function was moved from `jupyter_client` to `jupyter_core` recently, so fixing this bug will require a PR to jupyter\_core.

In the meantime, to work around the current issue of `zmq message arrived on closed channel`, I ended up writing a server for ipyflow that monkey patches `_TaskRunner.run` in `jupyter_core.utils` to use the original `nest_asyncio` approach.

For folks that were able to resolve the issue by pinning `jupyter_client`, you may be able to also work around the issue without pinning by installing ipyflow (regardless of whether you use the `ipyflow` kernel or `ipykernel`), but obviously it’s not a long term fix:

```auto
pip install --upgrade ipyflow jupyter_client jupyter_server jupyter_core tornado

```

---

<div class="post-metadata">

**Author:** ![Ryan\_Z](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/ryan_z/32/10386_2.png) [@Ryan\_Z](https://discourse.jupyter.org/u/Ryan_Z)\
**Post date:** [July 8, 2023, 6:04pm UTC](https://discourse.jupyter.org/t/jupyter-notebook-zmq-message-arrived-on-closed-channel-error/17869/29 "2023-07-08T18:04:56Z")

</div>

I am using docker jupyter: docker run --gpus all -p 8888:8888 tensorflow/tensofrflow:latest-gpu-jupyter

How to downgrad tornado for my case? I am new to tf jupyter docker…

---

<div class="post-metadata">

**Author:** ![drscotthawley](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/drscotthawley/32/4276_2.png) [@drscotthawley](https://discourse.jupyter.org/u/drscotthawley)\
**Post date:** [August 11, 2023, 4:28am UTC](https://discourse.jupyter.org/t/jupyter-notebook-zmq-message-arrived-on-closed-channel-error/17869/30 "2023-08-11T04:28:29Z")

</div>

Running the command @vasily mentioned did not solve it for me.  
Downgrading to `tornado==6.1` and/or `jupyter-client==7.3.2` also didn’t fix the problem.  
Using “`%matplotlib inline`” or “`%matplotlib notebook`” doesn’t make the error go away.

Problem occurs whenever I try to move a basic slider widget:

```python
import ipywidgets as widgets

@widgets.interact
def f(x=5):
    print(x)

```

Other examples from the [ipywidgets docs](https://ipywidgets.readthedocs.io/en/latest/examples/Using%20Interact.html) fail with the same error message.

---

<div class="post-metadata">

**Author:** ![teufelweich](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/teufelweich/32/9310_2.png) [@teufelweich](https://discourse.jupyter.org/u/teufelweich)\
**Post date:** [August 11, 2023, 9:06am UTC](https://discourse.jupyter.org/t/jupyter-notebook-zmq-message-arrived-on-closed-channel-error/17869/31 "2023-08-11T09:06:38Z")

</div>

To me, this issue only occurs when running my notebook with

```ipython
%load_ext autoreload
%autoreload 2

```

I have a lot of cells and it almost always happens running the `execute all cells above` command but less often when running them one by one, waiting for the prior cell to finish before sending the execute command for the next cell.

[Previous page](https://discourse.jupyter.org/t/jupyter-notebook-zmq-message-arrived-on-closed-channel-error/17869.md?page=1)
