Jupyter/Python extension hangs indefinitely when a notebook is restored on startup, but works fine when opened manually
- Dominant language
- TypeScript
- Stars
- 193k
- Forks
- 42.4k
- PR merge metrics
- PR metrics pending
Description
Type: Bug
**Environment:** Windows, VS Code with a Miniconda-managed Python environment, Jupyter + Python extensions installed.
**Steps:**
1. Open VS Code with a folder containing a `.ipynb` notebook, with a conda environment available.
2. Open the notebook, select a conda kernel, and run a cell — it works correctly.
3. Close VS Code without closing the notebook tab.
4. Reopen VS Code. It automatically restores the previously opened notebook tab (default behavior).
**Actual result:**
The Python/Jupyter extension appears to load indefinitely. The kernel never connects, and the notebook stays unresponsive. Commands such as `Python: Clear Cache and Reload Window` returns: Command 'Python: Clear Cache and Reload Window' resulted in an error - command 'python.clearCacheAndReload' not found, which suggests the Python extension itself has not finished activating by the time the notebook editor tries to use it.
**Expected result:**
The notebook and its kernel should connect reliably on startup, the same way they do when opened manually (see workaround below).
**Workaround found:**
If I close the notebook tab, fully close VS Code, reopen VS Code (with no notebook restored), and then manually reopen the same notebook from the Explorer, the kernel connects immediately and the conda environment is detected without issues.
This points to a race condition between the notebook editor being restored on startup and the Jupyter/Python extensions finishing activation in the extension host.
VS Code version: Code 1.135.0 (08d4889f9ec4a1685d257b9b95de036c8e1ce1e5, 2026-08-25T14:26:52Z)
OS version: Windows_NT x64 10.0.19045
Modes:
System Info
|Item|Value|
|---|---|
|CPUs|AMD Ryzen 7 1700X Eight-Core Processor (16 x 3768)|
|GPU Status|2d_canvas: enabled
GPU0: VENDOR= 0x10de, DEVICE=0x1b80 [NVIDIA GeForce GTX 1080], DRIVER_VENDOR=NVIDIA, DRIVER_VERSION=32.0.15.8266 *ACTIVE*
GPU1: VENDOR= 0x1414, DEVICE=0x008c [Microsoft Basic Render Driver], DRIVER_VERSION=10.0.19041.7548
Machine model name:
Machine model version:
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
trees_in_viz: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgpu: enabled
webnn: disabled_off|
|Load (avg)|undefined|
|Memory (System)|31.92GB (17.61GB free)|
|Process Argv|--crash-reporter-id e555bdfd-d4ae-478d-8fe1-289b24c7955e|
|Screen Reader|no|
|VM|0%|
Extensions (61)
Name|Identifier|Author|Version
---|---|---|---
CodeSnap|adpyke.codesnap|adpyke|1.3.4
Sublime Monokai|aryanahire.sublime-monokai|AryanAhire|0.2.9
Docker DX|docker.docker|docker|0.18.0
GitHub Repositories|github.remotehub|GitHub|0.64.0
GitHub Actions|github.vscode-github-actions|github|0.32.3
Rainbow CSV|mechatroner.rainbow-csv|mechatroner|3.24.1
Monokai Pro|monokai.theme-monokai-pro-vscode|monokai|2.0.14
Azure Developer CLI|ms-azuretools.azure-dev|ms-azuretools|0.10.0
GitHub Copilot for Azure|ms-azuretools.vscode-azure-github-copilot|ms-azuretools|1.0.231
Azure MCP Server|ms-azuretools.vscode-azure-mcp-server|ms-azuretools|2.0.46
Azure App Service|ms-azuretools.vscode-azureappservice|ms-azuretools|0.27.0
Azure Container Apps|ms-azuretools.vscode-azurecontainerapps|ms-azuretools|0.11.2
Azure Functions|ms-azuretools.vscode-azurefunctions|ms-azuretools|1.22.1
Azure Resources|ms-azuretools.vscode-azureresourcegroups|ms-azuretools|0.12.7
Azure Static Web Apps|ms-azuretools.vscode-azurestaticwebapps|ms-azuretools|0.13.3
Azure Storage|ms-azuretools.vscode-azurestorage|ms-azuretools|0.17.2
Azure Virtual Machines|ms-azuretools.vscode-azurevirtualmachines|ms-azuretools|0.6.11
Container Tools|ms-azuretools.vscode-containers|ms-azuretools|2.5.0
Azure Cosmos DB|ms-azuretools.vscode-cosmosdb|ms-azuretools|0.36.2
Docker|ms-azuretools.vscode-docker|ms-azuretools|2.0.0
C#|ms-dotnettools.csharp|ms-dotnettools|2.140.9
.NET Install Tool|ms-dotnettools.vscode-dotnet-runtime|ms-dotnettools|3.1.0
Kubernetes|ms-kubernetes-tools.vscode-kubernetes-tools|ms-kubernetes-tools|1.4.1
Python Debugger|ms-python.debugpy|ms-python|2026.6.0
Python|ms-python.python|ms-python|2026.4.0
Pylance|ms-python.vscode-pylance|ms-python|2026.3.1
Python Environments|ms-python.vscode-python-envs|ms-python|1.36.0
Data Wrangler|ms-toolsai.datawrangler|ms-toolsai|1.24.2
Jupyter|ms-toolsai.jupyter|ms-toolsai|2025.9.1
Jupyter Keymap|ms-toolsai.jupyter-keymap|ms-toolsai|1.1.2
Jupyter Notebook Renderers|ms-toolsai.jupyter-renderers|ms-toolsai|1.3.0
Azure Machine Learning|ms-toolsai.vscode-ai|ms-toolsai|1.4.2
Azure Machine Learning - Remote|ms-toolsai.vscode-ai-remote|ms-toolsai|1.4.9
Jupyter Cell Tags|ms-toolsai.vscode-jupyter-cell-tags|ms-toolsai|0.1.9
Jupyter PowerToys|ms-toolsai.vscode-jupyter-powertoys|ms-toolsai|0.1.1
Jupyter Slide Show|ms-toolsai.vscode-jupyter-slideshow|ms-toolsai|0.1.6
Dev Containers|ms-vscode-remote.remote-containers|ms-vscode-remote|0.466.0
Remote - SSH|ms-vscode-remote.remote-ssh|ms-vscode-remote|0.128.0
Remote - SSH: Editing Configuration Files|ms-vscode-remote.remote-ssh-edit|ms-vscode-remote|0.87.0
WSL|ms-vscode-remote.remote-wsl|ms-vscode-remote|0.104.3
Azure Repos|ms-vscode.azure-repos|ms-vscode|0.40.0
Azure CLI Tools|ms-vscode.azurecli|ms-vscode|0.6.0
Remote Explorer|ms-vscode.remote-explorer|ms-vscode|0.5.0
Remote Repositories|ms-vscode.remote-repositories|ms-vscode|0.42.0
Azure Tools|ms-vscode.vscode-node-azure-pack|ms-vscode|1.8.2
Foundry Toolkit for VS Code|ms-windows-ai-studio.windows-ai-studio|ms-windows-ai-studio|1.6.10
Language Support for Java(TM) by Red Hat|redhat.java|redhat|1.55.0
YAML|redhat.vscode-yaml|redhat|1.24.0
SynthWave '84|robbowen.synthwave-vscode|RobbOwen|0.1.20
Better Jinja|samuelcolvin.jinjahtml|samuelcolvin|0.20.0
FiraCode font - Professional Font for Developers|seyyedkhandon.firacode|SeyyedKhandon|2.2.2
Zip File Explorer|slevesque.vscode-zipexplorer|slevesque|0.3.1
vscode-pdf|tomoki1207.pdf|tomoki1207|1.2.2
GitHub Copilot modernization|vscjava.migrate-java-to-azure|vscjava|1.23.0
Gradle for Java|vscjava.vscode-gradle|vscjava|3.18.0
Debugger for Java|vscjava.vscode-java-debug|vscjava|0.59.0
Project Manager for Java|vscjava.vscode-java-dependency|vscjava|0.27.6
Extension Pack for Java|vscjava.vscode-java-pack|vscjava|0.31.1
Test Runner for Java|vscjava.vscode-java-test|vscjava|0.46.0
Maven for Java|vscjava.vscode-maven|vscjava|0.45.3
JavaScript (ES6) code snippets|xabikos.javascriptsnippets|xabikos|1.8.0
A/B Experiments
```
vsliv368cf:30146710
vswsl492cf:30256860
binariesv615:30325510
nativeloc1:31344060
dwcopilot:31170013
dwoutputs:31242946
copilot_t_ci:31333650
e5gg6876:31282496
pythonrdcb7:31342333
6518g693:31463988
aj953862:31281341
b6b4d950:31327385
envsactivate1:31551504
478i5457:31544283
cloudbuttont:31379625
3efgi100_wstrepl:31403338
ec5jj548:31422691
cp_cls_t_966_ss:31526232
4je02754:31466945
c3h7c220:31478652
cp_cls_c_1081:31454833
conptydll_true:31498968
e9c30283:31461165
46204921:31447328
capico_axe_098a3278:31555651
ei9d7968:31496641
chat:31457767
8hig5102:31480529
89g7j272:31518289
i2gc6536:31499202
52612955:31516516
h08i8180:31475369
23c7c724:31520045
ddid_c:31478207
hmra_i5g22:31518061
7df3h592:31512476
cp_cls_t_1082:31535311
logging_enabled_new:31498466
db5d2638:31499441
jb_cp_cls_t_632:31543129
56dj4588:31512888
32d76977:31512328
ha629193:31508444
jh5f2457_c:31540921
jbcp_cls_pctr_t:31531130
61138546:31518536
cp_intellij_t_nes:31548657
jf4hg949:31526829
ahp-both-windows:31556933
session_8:31532895
ihg5j128:31534457
f412h606:31551416
9gg7f176:31542112
nes-ex-cf-euporie-03:31542868
enable_editor_pane_layout:31569726
allow-none:31555437
36h42362:31564511
c7c27ce7:31554789
1h923230:31564177
1532g621_copy:31554320
treatment-23-1:31555779
unuse_dynamic_mcp:31555281
0d8dfbc3:31570291
maidictation:31565333
0c1h4866:31566224
session-mark-done:31558131
5b8j3302:31564601
mangle-name-control:31572633
signed-out-control:31574474
9e5id457:31573761
permission_prompt_control:1332567
ccr_pr_nudge_adoption:1319471
vsc_wsm_t:1340632
eh853263:1355661
auto_mode_treatment:1359304
```
Contributor guide
Assessment
This issue has not been assessed yet.