Description
Jupyter crashes after running jupyter execute inside a docker container after specifying to build on amd64 architecture (--platform=linux/amd64) from a Mac with arm64 architecture.
Downstream effect is that trying to run a VSCode interactive notebook session causes VSCode to crash.
Reproduce
- From a MacOS system with arm64 architecture, run any docker container built using the flag
--platform=linux/amd64.
Option A: from CLI
2. Install jupyterlab and ipykernel using pip3 install ipykernel jupyterlab
3. try to run any notebook using jupyter execute notebook.ipynb
4. observe CLI hanging, giving error after 60 seconds
Option B: interactive notebook session on VSCode
2. Open any .ipynb file
3. Select kernel
4. Press run on any executable cell
5. Observe VSCode hanging indefinitely
Running those same steps on the same system but without the flag --platform=linux/amd64 gives no issues.
Within the same setup, running ipython notebook.ipynb does not give any issues. The problem lies with running the jupyter command.
This repo provides a fully reproducible setup with an example devcontainer: https://github.com/emielvb/bug-report-jupyter
Multiple images have been explored, the issue appears solely with the flag --platform=linux/amd64.
Expected behavior
Running a notebook inside a container without crashes
Context
- Operating System and version: MacOS Tahoe - Version 26.2 (25C56)
- Chip: Apple M4 Pro (
arm64)
- Linux version inside container: Debian GNU/Linux 13 (trixie)
- JupyterLab version:
jupyter --version
Selected Jupyter core packages...
IPython : 9.9.0
ipykernel : 7.1.0
ipywidgets : not installed
jupyter_client : 8.8.0
jupyter_core : 5.9.1
jupyter_server : 2.17.0
jupyterlab : 4.5.2
nbclient : 0.10.4
nbconvert : 7.16.6
nbformat : 5.10.4
notebook : not installed
qtconsole : not installed
traitlets : 5.14.3
Troubleshoot Output
vscode ➜ /workspaces/bug-report-jupyter/amd64-example (develop) $ jupyter troubleshoot
$PATH:
/vscode/vscode-server/bin/linux-x64/994fd12f8d3a5aa16f17d42c041e5809167e845a/bin/remote-cli
/usr/local/python/current/bin
/usr/local/py-utils/bin
/usr/local/jupyter
/usr/local/share/nvm/current/bin
/usr/local/bin
/usr/local/python/current/bin
/usr/local/py-utils/bin
/usr/local/jupyter
/usr/local/share/nvm/current/bin
/usr/local/bin
/usr/local/sbin
/usr/local/bin
/usr/sbin
/usr/bin
/sbin
/bin
/home/vscode/.local/bin
sys.path:
/home/vscode/.local/bin
/usr/local/lib/python312.zip
/usr/local/lib/python3.12
/usr/local/lib/python3.12/lib-dynload
/home/vscode/.local/lib/python3.12/site-packages
/usr/local/lib/python3.12/site-packages
sys.executable:
/usr/local/bin/python3.12
sys.version:
3.12.12 (main, Oct 9 2025, 22:39:36) [GCC 14.2.0]
platform.platform():
Linux-6.10.14-linuxkit-x86_64-with-glibc2.41
which -a jupyter:
/home/vscode/.local/bin/jupyter
pip list:
Package Version
------------------------- -----------
anyio 4.12.1
argon2-cffi 25.1.0
argon2-cffi-bindings 25.1.0
arrow 1.4.0
asttokens 3.0.1
async-lru 2.1.0
attrs 25.4.0
babel 2.17.0
beautifulsoup4 4.14.3
bleach 6.3.0
certifi 2026.1.4
cffi 2.0.0
charset-normalizer 3.4.4
comm 0.2.3
debugpy 1.8.19
decorator 5.2.1
defusedxml 0.7.1
executing 2.2.1
fastjsonschema 2.21.2
fqdn 1.5.1
gitdb 4.0.12
GitPython 3.1.41
h11 0.16.0
httpcore 1.0.9
httpx 0.28.1
idna 3.11
ipykernel 7.1.0
ipython 9.9.0
ipython_pygments_lexers 1.1.1
isoduration 20.11.0
jedi 0.19.2
Jinja2 3.1.6
json5 0.13.0
jsonpointer 3.0.0
jsonschema 4.26.0
jsonschema-specifications 2025.9.1
jupyter_client 8.8.0
jupyter_core 5.9.1
jupyter-events 0.12.0
jupyter-lsp 2.3.0
jupyter_server 2.17.0
jupyter_server_terminals 0.5.4
jupyterlab 4.5.2
jupyterlab_pygments 0.3.0
jupyterlab_server 2.28.0
lark 1.3.1
MarkupSafe 3.0.3
matplotlib-inline 0.2.1
mistune 3.2.0
nbclient 0.10.4
nbconvert 7.16.6
nbformat 5.10.4
nest-asyncio 1.6.0
notebook_shim 0.2.4
packaging 25.0
pandocfilters 1.5.1
parso 0.8.5
pexpect 4.9.0
pip 25.0.1
platformdirs 4.5.1
prometheus_client 0.24.1
prompt_toolkit 3.0.52
psutil 7.2.1
ptyprocess 0.7.0
pure_eval 0.2.3
pycparser 2.23
Pygments 2.19.2
python-dateutil 2.9.0.post0
python-json-logger 4.0.0
PyYAML 6.0.3
pyzmq 27.1.0
referencing 0.37.0
requests 2.32.5
rfc3339-validator 0.1.4
rfc3986-validator 0.1.1
rfc3987-syntax 1.1.0
rpds-py 0.30.0
Send2Trash 2.1.0
setuptools 78.1.1
six 1.17.0
smmap 5.0.2
soupsieve 2.8.3
stack-data 0.6.3
terminado 0.18.1
tinycss2 1.4.0
tornado 6.5.4
traitlets 5.14.3
typing_extensions 4.15.0
tzdata 2025.3
uri-template 1.3.0
urllib3 2.6.3
wcwidth 0.2.14
webcolors 25.10.0
webencodings 0.5.1
websocket-client 1.9.0
Command Line Output
vscode ➜ /workspaces/bug-report-jupyter/amd64-example (develop) $ jupyter execute test.ipynb
[NbClientApp] Executing test.ipynb
[NbClientApp] ERROR | Error occurred while starting new kernel client for kernel 94f9ddce-fe98-4d7a-b0b2-b3140c08c494: Kernel didn't respond in 60 seconds
Traceback (most recent call last):
File "/home/vscode/.local/bin/jupyter-execute", line 8, in
sys.exit(main())
^^^^^^
File "/home/vscode/.local/lib/python3.12/site-packages/jupyter_core/application.py", line 284, in launch_instance
super().launch_instance(argv=argv, **kwargs)
File "/home/vscode/.local/lib/python3.12/site-packages/traitlets/config/application.py", line 1074, in launch_instance
app.initialize(argv)
File "/home/vscode/.local/lib/python3.12/site-packages/traitlets/config/application.py", line 118, in inner
return method(app, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/vscode/.local/lib/python3.12/site-packages/nbclient/cli.py", line 161, in initialize
self.run_notebook(path)
File "/home/vscode/.local/lib/python3.12/site-packages/nbclient/cli.py", line 215, in run_notebook
client.execute()
File "/home/vscode/.local/lib/python3.12/site-packages/jupyter_core/utils/__init__.py", line 165, in wrapped
return loop.run_until_complete(inner)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/asyncio/base_events.py", line 691, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/home/vscode/.local/lib/python3.12/site-packages/nbclient/client.py", line 693, in async_execute
async with self.async_setup_kernel(**kwargs):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/contextlib.py", line 210, in __aenter__
return await anext(self.gen)
^^^^^^^^^^^^^^^^^^^^^
File "/home/vscode/.local/lib/python3.12/site-packages/nbclient/client.py", line 651, in async_setup_kernel
await self.async_start_new_kernel_client()
File "/home/vscode/.local/lib/python3.12/site-packages/nbclient/client.py", line 566, in async_start_new_kernel_client
await ensure_async(self.kc.wait_for_ready(timeout=self.startup_timeout))
File "/home/vscode/.local/lib/python3.12/site-packages/jupyter_core/utils/__init__.py", line 214, in ensure_async
result = await obj
^^^^^^^^^
File "/home/vscode/.local/lib/python3.12/site-packages/jupyter_client/client.py", line 208, in _async_wait_for_ready
raise RuntimeError("Kernel didn't respond in %d seconds" % timeout)
RuntimeError: Kernel didn't respond in 60 seconds
Exception ignored in atexit callback: .wrapped of >
Traceback (most recent call last):
File "/home/vscode/.local/lib/python3.12/site-packages/jupyter_core/utils/__init__.py", line 165, in wrapped
return loop.run_until_complete(inner)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/asyncio/base_events.py", line 691, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/home/vscode/.local/lib/python3.12/site-packages/nbclient/client.py", line 504, in _async_cleanup_kernel
assert self.km is not None
^^^^^^^^^^^^^^^^^^^
AssertionError:
vscode ➜ /workspaces/bug-report-jupyter/amd64-example (develop) $
Description
Jupyter crashes after running
jupyter executeinside a docker container after specifying to build on amd64 architecture (--platform=linux/amd64) from a Mac with arm64 architecture.Downstream effect is that trying to run a VSCode interactive notebook session causes VSCode to crash.
Reproduce
--platform=linux/amd64.Option A: from CLI
2. Install jupyterlab and ipykernel using
pip3 install ipykernel jupyterlab3. try to run any notebook using
jupyter execute notebook.ipynb4. observe CLI hanging, giving error after 60 seconds
Option B: interactive notebook session on VSCode
2. Open any
.ipynbfile3. Select kernel
4. Press run on any executable cell
5. Observe VSCode hanging indefinitely
Running those same steps on the same system but without the flag
--platform=linux/amd64gives no issues.Within the same setup, running
ipython notebook.ipynbdoes not give any issues. The problem lies with running thejupytercommand.This repo provides a fully reproducible setup with an example devcontainer: https://github.com/emielvb/bug-report-jupyter
Multiple images have been explored, the issue appears solely with the flag
--platform=linux/amd64.Expected behavior
Running a notebook inside a container without crashes
Context
arm64)Troubleshoot Output
vscode ➜ /workspaces/bug-report-jupyter/amd64-example (develop) $ jupyter troubleshoot $PATH: /vscode/vscode-server/bin/linux-x64/994fd12f8d3a5aa16f17d42c041e5809167e845a/bin/remote-cli /usr/local/python/current/bin /usr/local/py-utils/bin /usr/local/jupyter /usr/local/share/nvm/current/bin /usr/local/bin /usr/local/python/current/bin /usr/local/py-utils/bin /usr/local/jupyter /usr/local/share/nvm/current/bin /usr/local/bin /usr/local/sbin /usr/local/bin /usr/sbin /usr/bin /sbin /bin /home/vscode/.local/binsys.path:
/home/vscode/.local/bin
/usr/local/lib/python312.zip
/usr/local/lib/python3.12
/usr/local/lib/python3.12/lib-dynload
/home/vscode/.local/lib/python3.12/site-packages
/usr/local/lib/python3.12/site-packages
sys.executable:
/usr/local/bin/python3.12
sys.version:
3.12.12 (main, Oct 9 2025, 22:39:36) [GCC 14.2.0]
platform.platform():
Linux-6.10.14-linuxkit-x86_64-with-glibc2.41
which -a jupyter:
/home/vscode/.local/bin/jupyter
pip list:
Package Version
------------------------- -----------
anyio 4.12.1
argon2-cffi 25.1.0
argon2-cffi-bindings 25.1.0
arrow 1.4.0
asttokens 3.0.1
async-lru 2.1.0
attrs 25.4.0
babel 2.17.0
beautifulsoup4 4.14.3
bleach 6.3.0
certifi 2026.1.4
cffi 2.0.0
charset-normalizer 3.4.4
comm 0.2.3
debugpy 1.8.19
decorator 5.2.1
defusedxml 0.7.1
executing 2.2.1
fastjsonschema 2.21.2
fqdn 1.5.1
gitdb 4.0.12
GitPython 3.1.41
h11 0.16.0
httpcore 1.0.9
httpx 0.28.1
idna 3.11
ipykernel 7.1.0
ipython 9.9.0
ipython_pygments_lexers 1.1.1
isoduration 20.11.0
jedi 0.19.2
Jinja2 3.1.6
json5 0.13.0
jsonpointer 3.0.0
jsonschema 4.26.0
jsonschema-specifications 2025.9.1
jupyter_client 8.8.0
jupyter_core 5.9.1
jupyter-events 0.12.0
jupyter-lsp 2.3.0
jupyter_server 2.17.0
jupyter_server_terminals 0.5.4
jupyterlab 4.5.2
jupyterlab_pygments 0.3.0
jupyterlab_server 2.28.0
lark 1.3.1
MarkupSafe 3.0.3
matplotlib-inline 0.2.1
mistune 3.2.0
nbclient 0.10.4
nbconvert 7.16.6
nbformat 5.10.4
nest-asyncio 1.6.0
notebook_shim 0.2.4
packaging 25.0
pandocfilters 1.5.1
parso 0.8.5
pexpect 4.9.0
pip 25.0.1
platformdirs 4.5.1
prometheus_client 0.24.1
prompt_toolkit 3.0.52
psutil 7.2.1
ptyprocess 0.7.0
pure_eval 0.2.3
pycparser 2.23
Pygments 2.19.2
python-dateutil 2.9.0.post0
python-json-logger 4.0.0
PyYAML 6.0.3
pyzmq 27.1.0
referencing 0.37.0
requests 2.32.5
rfc3339-validator 0.1.4
rfc3986-validator 0.1.1
rfc3987-syntax 1.1.0
rpds-py 0.30.0
Send2Trash 2.1.0
setuptools 78.1.1
six 1.17.0
smmap 5.0.2
soupsieve 2.8.3
stack-data 0.6.3
terminado 0.18.1
tinycss2 1.4.0
tornado 6.5.4
traitlets 5.14.3
typing_extensions 4.15.0
tzdata 2025.3
uri-template 1.3.0
urllib3 2.6.3
wcwidth 0.2.14
webcolors 25.10.0
webencodings 0.5.1
websocket-client 1.9.0
Command Line Output
vscode ➜ /workspaces/bug-report-jupyter/amd64-example (develop) $ jupyter execute test.ipynb [NbClientApp] Executing test.ipynb [NbClientApp] ERROR | Error occurred while starting new kernel client for kernel 94f9ddce-fe98-4d7a-b0b2-b3140c08c494: Kernel didn't respond in 60 seconds Traceback (most recent call last): File "/home/vscode/.local/bin/jupyter-execute", line 8, in sys.exit(main()) ^^^^^^ File "/home/vscode/.local/lib/python3.12/site-packages/jupyter_core/application.py", line 284, in launch_instance super().launch_instance(argv=argv, **kwargs) File "/home/vscode/.local/lib/python3.12/site-packages/traitlets/config/application.py", line 1074, in launch_instance app.initialize(argv) File "/home/vscode/.local/lib/python3.12/site-packages/traitlets/config/application.py", line 118, in inner return method(app, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/vscode/.local/lib/python3.12/site-packages/nbclient/cli.py", line 161, in initialize self.run_notebook(path) File "/home/vscode/.local/lib/python3.12/site-packages/nbclient/cli.py", line 215, in run_notebook client.execute() File "/home/vscode/.local/lib/python3.12/site-packages/jupyter_core/utils/__init__.py", line 165, in wrapped return loop.run_until_complete(inner) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/asyncio/base_events.py", line 691, in run_until_complete return future.result() ^^^^^^^^^^^^^^^ File "/home/vscode/.local/lib/python3.12/site-packages/nbclient/client.py", line 693, in async_execute async with self.async_setup_kernel(**kwargs): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/home/vscode/.local/lib/python3.12/site-packages/nbclient/client.py", line 651, in async_setup_kernel await self.async_start_new_kernel_client() File "/home/vscode/.local/lib/python3.12/site-packages/nbclient/client.py", line 566, in async_start_new_kernel_client await ensure_async(self.kc.wait_for_ready(timeout=self.startup_timeout)) File "/home/vscode/.local/lib/python3.12/site-packages/jupyter_core/utils/__init__.py", line 214, in ensure_async result = await obj ^^^^^^^^^ File "/home/vscode/.local/lib/python3.12/site-packages/jupyter_client/client.py", line 208, in _async_wait_for_ready raise RuntimeError("Kernel didn't respond in %d seconds" % timeout) RuntimeError: Kernel didn't respond in 60 seconds Exception ignored in atexit callback: .wrapped of > Traceback (most recent call last): File "/home/vscode/.local/lib/python3.12/site-packages/jupyter_core/utils/__init__.py", line 165, in wrapped return loop.run_until_complete(inner) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/asyncio/base_events.py", line 691, in run_until_complete return future.result() ^^^^^^^^^^^^^^^ File "/home/vscode/.local/lib/python3.12/site-packages/nbclient/client.py", line 504, in _async_cleanup_kernel assert self.km is not None ^^^^^^^^^^^^^^^^^^^ AssertionError: vscode ➜ /workspaces/bug-report-jupyter/amd64-example (develop) $