Closed paul-rogers closed 2 weeks ago
Thank you for filing this issue and sorry you ran into this. Are you able to repro this issue using the same steps?
@DonJayamanne, this issue has happened only once. I have been using VS Code and Juypter regularly for over a year now and this is the first time that the problem has appeared. I did just update VS Code with the latest available, so perhaps something changed in the latest version?
Thanks for the prompt response.
We haven't made any changes in this space, its more likely related to some other issue we're looking at. Most likely a duplicate of https://github.com/microsoft/vscode-jupyter/issues/15716 Given that you cannot repro this and we have a similar issue, lets close this for now, as unfortunately theres' not much we can do at this point. Please do not misunderstand me, i'm not saying I will not fix this, but without repro steps or the like, its difficult to resolve this. Also its possible its just a dup of the issue mentioned earlier.
If however you do run into this, please do check the logs again & share the full logs (the contents in the logs before the error is crucial in this case), it would tell us whether the notebook was closed or a cell was deleted (visually the notebook may not be closed, however the notebook object may have been closed/disposed which results in such errors).
If you run into this again, please feel free to create a new issue or ping here and we'll re-open this, Most importantly, please do share the full logs. thanks
@DonJayamanne, please tell me more about the logs you need.
Is it from the same Output window from which I copied the logs in this bug? If so, there were no other recent entries: the prior entries were from some hours before describing that I had started a debug session. (I know this because I used the timestamps to determine which parts of the logs to copy.)
Also, I had not closed the notebook (or any file for that matter) at the time of the issue, nor had I deleted a cell recently. The most recent cell action was likely the addition of a cell before going to edit the cell that raised the issue. The new cell was several below the cell where the error occurred.
It is understood that you need more info. Sorry the detailed logs were not enough. Let me know what you need in case it occurs again.
@DonJayamanne, FWIW here are the logs for a few operations before the one that had the above error. Looking closely, there were other instances of the "notebook controller is DISPOSED" error, but they did not result in an error message in the notebook itself.
(About 20 of the following)
15:37:52.797 [info] Disposing request as the cell (-1) was deleted ~/path/to/notebook.ipynb
(more lines line the following)
5:51:59.895 [info] Starting debugging with mode 1
15:53:32.459 [info] Ending debug session a4cf8db0-f4cc-43d6-b408-31c51fd06236
15:53:32.460 [info] Ending debug session a4cf8db0-f4cc-43d6-b408-31c51fd06236
15:53:32.517 [warn] Cell completed with errors [iu [Error]: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
at n.execute (/home/~/.vscode/extensions/ms-toolsai.jupyter-2024.10.0-linux-x64/dist/extension.node.js:297:4958)] {
ename: 'ValueError',
evalue: 'omitted',
traceback: [<omitted>]
}
15:53:42.132 [info] Starting debugging with mode 1
15:54:42.513 [info] Ending debug session 5ccf3070-9cce-4c6f-9110-209a7cc0d1db
15:54:45.272 [info] Ending debug session 5ccf3070-9cce-4c6f-9110-209a7cc0d1db
15:54:45.272 [info] Ending debug session 5ccf3070-9cce-4c6f-9110-209a7cc0d1db
17:07:14.642 [info] Starting debugging with mode 1
17:09:19.428 [info] Ending debug session 7b70f8b8-3fde-40c2-ba1a-c805b0dc769a
17:09:19.428 [info] Ending debug session 7b70f8b8-3fde-40c2-ba1a-c805b0dc769a
17:18:47.040 [info] Starting debugging with mode 1
17:20:04.912 [error] Error in cell execution [Error: notebook controller is DISPOSED
at Object.createNotebookCellExecution (file:///usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:155:20981)
at n.create (/home/~/.vscode/extensions/ms-toolsai.jupyter-2024.10.0-linux-x64/dist/extension.node.js:115:29606)
at n.getOrCreate (/home/~/.vscode/extensions/ms-toolsai.jupyter-2024.10.0-linux-x64/dist/extension.node.js:115:29374)
at new n (/home/~/.vscode/extensions/ms-toolsai.jupyter-2024.10.0-linux-x64/dist/extension.node.js:296:2955)
at n.fromCell (/home/~/.vscode/extensions/ms-toolsai.jupyter-2024.10.0-linux-x64/dist/extension.node.js:296:3195)
at l_.create (/home/~/.vscode/extensions/ms-toolsai.jupyter-2024.10.0-linux-x64/dist/extension.node.js:296:2272)
at d_.enqueue (/home/~/.vscode/extensions/ms-toolsai.jupyter-2024.10.0-linux-x64/dist/extension.node.js:298:2603)
at d_.queueCell (/home/~/.vscode/extensions/ms-toolsai.jupyter-2024.10.0-linux-x64/dist/extension.node.js:298:2313)
at p_.executeCell (/home/~/.vscode/extensions/ms-toolsai.jupyter-2024.10.0-linux-x64/dist/extension.node.js:298:8858)
at /home/~/.vscode/extensions/ms-toolsai.jupyter-2024.10.0-linux-x64/dist/extension.node.js:304:94526
at Array.map (<anonymous>)
at n.executeQueuedCells (/home/~/.vscode/extensions/ms-toolsai.jupyter-2024.10.0-linux-x64/dist/extension.node.js:304:94355)
at async n.handleExecution (/home/~/.vscode/extensions/ms-toolsai.jupyter-2024.10.0-linux-x64/dist/extension.node.js:304:90678)
at async Ob.$executeCells (file:///usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:155:24038)]
17:20:04.913 [error] Error in execution (get message for cell) [Error: notebook controller is DISPOSED
at Object.createNotebookCellExecution (file:///usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:155:20981)
at n.create (/home/~/.vscode/extensions/ms-toolsai.jupyter-2024.10.0-linux-x64/dist/extension.node.js:115:29606)
at n.getOrCreate (/home/~/.vscode/extensions/ms-toolsai.jupyter-2024.10.0-linux-x64/dist/extension.node.js:115:29374)
at new n (/home/~/.vscode/extensions/ms-toolsai.jupyter-2024.10.0-linux-x64/dist/extension.node.js:296:2955)
at n.fromCell (/home/~/.vscode/extensions/ms-toolsai.jupyter-2024.10.0-linux-x64/dist/extension.node.js:296:3195)
at l_.create (/home/~/.vscode/extensions/ms-toolsai.jupyter-2024.10.0-linux-x64/dist/extension.node.js:296:2272)
at d_.enqueue (/home/~/.vscode/extensions/ms-toolsai.jupyter-2024.10.0-linux-x64/dist/extension.node.js:298:2603)
at d_.queueCell (/home/~/.vscode/extensions/ms-toolsai.jupyter-2024.10.0-linux-x64/dist/extension.node.js:298:2313)
at p_.executeCell (/home/~/.vscode/extensions/ms-toolsai.jupyter-2024.10.0-linux-x64/dist/extension.node.js:298:8858)
at /home/~/.vscode/extensions/ms-toolsai.jupyter-2024.10.0-linux-x64/dist/extension.node.js:304:94526
at Array.map (<anonymous>)
at n.executeQueuedCells (/home/~/.vscode/extensions/ms-toolsai.jupyter-2024.10.0-linux-x64/dist/extension.node.js:304:94355)
at async n.handleExecution (/home/~/.vscode/extensions/ms-toolsai.jupyter-2024.10.0-linux-x64/dist/extension.node.js:304:90678)
at async Ob.$executeCells (file:///usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:155:24038)]
17:20:11.984 [info] Ending debug session f99dad72-e64d-4190-b02f-6b670dc9c0e7
17:20:11.985 [info] Ending debug session f99dad72-e64d-4190-b02f-6b670dc9c0e7
17:20:38.619 [info] Starting debugging with mode 1
17:21:08.381 [info] Ending debug session a2c0bb53-c7dd-441c-adc5-28e6da61d886
17:21:10.400 [info] Ending debug session a2c0bb53-c7dd-441c-adc5-28e6da61d886
17:21:10.400 [info] Ending debug session a2c0bb53-c7dd-441c-adc5-28e6da61d886
20:31:08.269 [warn] Cell completed with errors [iu [Error]: Cannot cast ufunc 'divide' output from dtype('float64') to dtype('int64') with casting rule 'same_kind'
at n.execute (/home/~/.vscode/extensions/ms-toolsai.jupyter-2024.10.0-linux-x64/dist/extension.node.js:297:4958)] {
ename: 'UFuncTypeError',
evalue: "omitted'",
traceback: [<omitted>]
}
20:32:08.062 [warn] Cell completed with errors [iu [Error]: 'str' object has no attribute 'trim'
at n.execute (/home/~/.vscode/extensions/ms-toolsai.jupyter-2024.10.0-linux-x64/dist/extension.node.js:297:4958)] {
ename: 'AttributeError',
evalue: "omitted",
traceback: [<omitted>]
}
20:34:12.930 [info] Starting debugging with mode 1
20:34:49.246 [info] Ending debug session db902757-add9-4d10-8b36-f87d7f3d1c4b
20:34:51.751 [info] Ending debug session db902757-add9-4d10-8b36-f87d7f3d1c4b
20:34:51.751 [info] Ending debug session db902757-add9-4d10-8b36-f87d7f3d1c4b
20:38:06.151 [info] Starting debugging with mode 1
20:39:20.614 [error] Error in cell execution [Error: notebook controller is DISPOSED
The last line above is the one reported earlier.
Please can you re-load VS Code and replicate the issue and share the full log (start to end).
Please could you enable logging as follows:
Jupyter->Logging
trace
Jupyter
output panel (use the command Jupyter: Show Output
to get to the logs).Thanks for the info. Your timing was perfect: the problem just happened again. I believe I may have tracked down more of the specifics for you.
VS Code had been idle for some hours. I sat down and started editing some code, then ran a cell that referenced that code. The error again appeared, in red, below the cell:
notebook controller is DISPOSED.
In the logs (with info
setting for now):
21:11:05.733 [info] Too many pending requests 1 for kernel 1a6ae5aa-2bea-43c5-b790-ce1eb53017ab, waiting for it to be ready.
21:30:03.893 [error] Error in cell execution [Error: notebook controller is DISPOSED
at Object.createNotebookCellExecution (file:///usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:155:20981)
at n.create (/home/~/.vscode/extensions/ms-toolsai.jupyter-2024.10.0-linux-x64/dist/extension.node.js:115:29606)
...
This time the cause is that my edit introduced an (unintended) infinite loop. So, when I ran cell A, Python went into a loop. However, expecting that the code would execute immediately, I also ran cell B. That is when the above error occurred.
The possible parallel with the previous case is that I was debugging, stopped at a break point, when I recognized an issue, changed the code, and ran the cell containing the function in question. Thus, I asked Python to run a cell while a debug session was active.
Indeed, I can now reliably reproduce the error by again executing my code with the bug that causes the infinite loop (cell "A" above), then, while running, execute cell "B". But, only when another condition has also occurred, as explained below.
Next, I changed the log setting as requested, restarted VS Code and repeated the above scenario. This time, no error.
So, that brings us to one additional factor. Issue VS Code Issue #24364 describes my attempts to deal with an upgraded Python interpreter. In both sessions where the failure occurred, I configured a Python virtual environment by hand, then chose that environment in Jupyter. What reminded me of this was that, in the prior session (alas, now gone, so I can't copy the log lines), I saw Jupyter logging messages that it had detected the change in kernel.
To test this, I again went though the steps in VS Code Issue #24364 to select the recommended interpreter (so that the interpreter changes), then to manually configure my virtual environment. As described in that other issue, Jupyter "lost" the kernel when I switch to the recommended one, then "remembered" the kernel when I switched back to my virtual environment. I then reran the required code cells in my notebook, including the one with the buggy infinite loop (cell "A"). As before, with that cell running, I ran cell "B" and again got the notebook controller is DISPOSED.
error. Thus, the error concerns:
Logs:
Visual Studio Code (1.95.0, undefined, desktop)
Jupyter Extension Version: 2024.10.0.
Python Extension Version: 2024.16.1.
Pylance Extension Version: 2024.10.1.
Platform: linux (x64).
...
(entries for the attempt to reproduce that did not trigger the error)
...
21:51:50.858 [trace] Python API env change detected, update => '/home/~/pyenv/3.12/bin/python'
21:51:50.858 [debug] Start refreshing Kernel Picker (1730436710858)
21:51:50.859 [debug] End refreshing Kernel Picker (1730436710858)
21:51:55.002 [debug] Handle Execution of Cells 4 for ~/omitted.ipynb
21:51:55.003 [trace] Execute Notebook ~/omitted.ipynb. Step 1
21:51:55.003 [trace] Connect to Kernel ~/omitted.ipynb. Step 2
21:51:55.008 [trace] Connected to Kernel ~/omitted.ipynb. Step 3
21:51:55.008 [trace] executeCell 4. Step 4
21:51:55.008 [trace] Cell Index:4 sent to kernel
21:51:55.011 [trace] Start cell 4 execution @ 1730436715011 (clear output)
21:51:55.011 [debug] Kernel acknowledged execution of cell 4 @ 1730436715011
21:51:55.019 [trace] Cell 4 completed in 0.006s (start: 1730436715011, end: 1730436715017)
21:51:55.019 [trace] Cell 4 executed successfully
21:52:01.337 [debug] Handle Execution of Cells 22 for ~/omitted.ipynb
21:52:01.338 [trace] Execute Notebook ~/omitted.ipynb. Step 1
21:52:01.338 [trace] Connect to Kernel ~/omitted.ipynb. Step 2
21:52:01.339 [trace] Connected to Kernel ~omitted.ipynb. Step 3
21:52:01.339 [trace] executeCell 22. Step 4
21:52:01.339 [trace] Cell Index:22 sent to kernel
21:52:01.362 [trace] Start cell 22 execution @ 1730436721362 (clear output)
21:52:01.362 [debug] Kernel acknowledged execution of cell 22 @ 1730436721362
21:52:05.672 [debug] Handle Execution of Cells 23 for ~/omitted.ipynb
21:52:05.672 [trace] Execute Notebook ~/omitted.ipynb. Step 1
21:52:05.672 [trace] Connect to Kernel ~/omitted.ipynb. Step 2
21:52:05.672 [trace] Connected to Kernel ~/omitted.ipynb. Step 3
21:52:05.673 [trace] executeCell 23. Step 4
21:52:05.673 [error] Error in cell execution [Error: notebook controller is DISPOSED
The ~/omitted.ipynb
above is just the obfuscated path to my notebook.
@paul-rogers Please can you share the full logs. We're missing information about
Also, please can you add the following setting into your settings folder
"jupyter.enableKernelCompletions": false
Optionally you can just do this via the settings ui (once done please reload VS Code)
As requested, here is a session with full logs and new notebook.
I was earlier wrestling with getting the Python extension to find my virtual environment. After realizing that the documentation was incomplete, and taking the necessary steps, my virtual environment now does appear in the Python: Select Interpreter
list. So, the part of the description about Select Kernel
not finding my environment is moot. This issue is about the DISPOSED
error, the interpreter issue was a confounding factor.
Also, as requested in another issue, I did update the Python extension to the newest version, so the following description is with the latest version.
To start, let's just set up the kernel:
Python: Select Interpreter
.Select Kernel
, then Python Environments...
and selected by virtual environment.Logs thus far. The contents seem to contain many errors that I did not see in sessions reported above.
Visual Studio Code (1.95.0, undefined, desktop)
Jupyter Extension Version: 2024.10.0.
Python Extension Version: 2024.18.0.
Pylance Extension Version: 2024.10.1.
Platform: linux (x64).
Temp Storage folder ~/.config/Code/User/globalStorage/ms-toolsai.jupyter/version-2024.10.0
Workspace folder ~/testproj, Home = /home/paul
11:10:16.409 [debug] Start refreshing Kernel Picker (1730484616409)
11:10:17.473 [trace] Kernel Spec for 'Python 3 (ipykernel)' (~/.local/share/jupyter/kernels/python3/kernel.json) is hidden. (isDefaultKernelSpec = true, language = python, registrationInfo = undefined)
11:10:17.474 [debug] Get Custom Env Variables, Class name = Em, completed in 1065ms, has a truthy return value, Arg 1: undefined, Arg 2: "RunPythonCode"
11:10:17.474 [debug] Jupyter Paths /kernels:
11:10:17.474 [debug] Kernel Spec Root Paths, /usr/share/jupyter/kernels, /usr/local/share/jupyter/kernels, ~/.local/share/jupyter/kernels
11:10:18.096 [debug] End refreshing Kernel Picker (1730484616409)
11:10:18.101 [trace] Python API env change detected, add => 'pyenv/3.12-old/bin/python'
11:10:18.102 [trace] Search for KernelSpecs in Interpreter /pyenv/3.12-old/bin/python
11:10:18.102 [debug] Start refreshing Kernel Picker (1730484618102)
11:10:18.109 [debug] End refreshing Kernel Picker (1730484618102)
11:10:18.111 [trace] Python API env change detected, add => '/home/~/pyenv/3.12/bin/python'
11:10:18.111 [trace] Search for KernelSpecs in Interpreter ~/pyenv/3.12/bin/python
11:10:18.112 [debug] Start refreshing Kernel Picker (1730484618112)
11:10:18.118 [trace] Python API env change detected, add => 'pyenv/3.12/bin/python'
11:10:18.119 [trace] Search for KernelSpecs in Interpreter /pyenv/3.12/bin/python
11:10:18.140 [trace] Python API env change detected, add => '/home/~/pyenv/3.12-old/bin/python'
11:10:18.140 [trace] Search for KernelSpecs in Interpreter ~/pyenv/3.12-old/bin/python
11:10:18.151 [trace] Hiding default KernelSpec /python for interpreter ~/pyenv/3.12/bin/python (KernelSpec file ~/pyenv/3.12/share/jupyter/kernels/python3/kernel.json)
11:10:18.165 [trace] Hiding default KernelSpec /python for interpreter ~/pyenv/3.12-old/bin/python (KernelSpec file ~/pyenv/3.12-old/share/jupyter/kernels/python3/kernel.json)
11:10:18.166 [debug] End refreshing Kernel Picker (1730484618112)
11:10:18.168 [trace] Python API env change detected, add => '/bin/python3'
11:10:18.169 [trace] Search for KernelSpecs in Interpreter /bin/python3
11:10:18.169 [debug] Start refreshing Kernel Picker (1730484618169)
11:10:18.172 [debug] End refreshing Kernel Picker (1730484618169)
11:10:18.174 [trace] Python API env change detected, add => '/usr/bin/python3'
11:10:18.174 [trace] Search for KernelSpecs in Interpreter /usr/bin/python3
11:10:18.174 [debug] Start refreshing Kernel Picker (1730484618174)
11:10:18.177 [debug] End refreshing Kernel Picker (1730484618174)
11:10:18.180 [trace] Python API env change detected, add => '/home/~/anaconda3/bin/python'
11:10:18.180 [trace] Search for KernelSpecs in Interpreter ~/anaconda3/bin/python
11:10:18.180 [debug] Start refreshing Kernel Picker (1730484618180)
11:10:18.185 [trace] Hiding default KernelSpec ~/anaconda3/bin/python for interpreter ~/anaconda3/bin/python (KernelSpec file ~/anaconda3/share/jupyter/kernels/python3/kernel.json)
11:10:18.186 [debug] End refreshing Kernel Picker (1730484618180)
11:10:18.506 [trace] Conda file is /home/~/anaconda3/bin/conda
11:10:34.774 [trace] Python API env change detected, update => 'pyenv/3.12/bin/python'
11:10:34.774 [trace] Search for KernelSpecs in Interpreter /pyenv/3.12/bin/python
11:10:34.775 [debug] Start refreshing Kernel Picker (1730484634775)
11:10:34.778 [trace] Hiding default KernelSpec /python for interpreter ~/pyenv/3.12/bin/python (KernelSpec file ~/pyenv/3.12/share/jupyter/kernels/python3/kernel.json)
11:10:34.780 [debug] End refreshing Kernel Picker (1730484634775)
11:10:34.791 [debug] Get Custom Env Variables, Class name = Em, completed in 1ms, has a truthy return value, Arg 1: "~/testproj", Arg 2: "RunPythonCode"
11:10:34.829 [debug] KernelProvider switched kernel to id = .jvsc74a57bd0da0c5df3dd3647ad5d4882cd2acf3882f3baa2bd3e4126fcd690f3b43894195a./pyenv/3.12/python./pyenv/3.12/python.-m#ipykernel_launcher
11:10:34.829 [debug] start the kernel, options.disableUI=true for ~/testproj/Test.ipynb
11:10:34.880 [trace] Registering commtarget jupyter.widget
11:10:34.882 [debug] Controller selection change completed
11:10:34.882 [info] Starting Kernel (Python Path: /pyenv/3.12/bin/python, Venv, 3.12.3) for '~/testproj/Test.ipynb' (disableUI=true)
11:10:34.883 [trace] Creating raw notebook for resource '~/testproj/Test.ipynb'
11:10:34.895 [debug] Get Custom Env Variables, Class name = Em, completed in 2ms, has a truthy return value, Arg 1: "~/testproj/Test.ipynb", Arg 2: "RunPythonCode"
11:10:34.908 [debug] Launching kernel .jvsc74a57bd0da0c5df3dd3647ad5d4882cd2acf3882f3baa2bd3e4126fcd690f3b43894195a./pyenv/3.12/python./pyenv/3.12/python.-m#ipykernel_launcher for ~/testproj/Test.ipynb in //home/~/testproj with ports 9001, 9000, 9004, 9002, 9003
11:10:34.913 [debug] Got env vars from Python Ext in 123ms for /pyenv/3.12/bin/python, with env var count 60.
11:10:34.913 [trace] Prepend PATH with python bin for /pyenv/3.12/bin/python
11:10:34.914 [debug] Getting activated env variables, Class name = Id, completed in 125ms, has a truthy return value, Arg 1: "~/testproj", Arg 2: "pyenv/3.12/bin/python", Arg 3: undefined
11:10:34.922 [info] Process Execution: /pyenv/3.12/bin/python -m pip list
11:10:34.926 [debug] Got env vars from Python Ext in 33ms for /pyenv/3.12/bin/python, with env var count 60.
11:10:34.927 [trace] Prepend PATH with python bin for /pyenv/3.12/bin/python
11:10:34.927 [debug] Getting activated env variables, Class name = Id, completed in 34ms, has a truthy return value, Arg 1: "~/testproj/Test.ipynb", Arg 2: "pyenv/3.12/bin/python", Arg 3: undefined
11:10:34.933 [info] Process Execution: /pyenv/3.12/bin/python -c "import ipykernel; print(ipykernel.__version__); print("5dc3a68c-e34e-4080-9c3e-2a532b2ccb4d"); print(ipykernel.__file__)"
11:10:34.940 [info] Process Execution: /pyenv/3.12/bin/python -m ipykernel_launcher --f=/home/~/.local/share/jupyter/runtime/kernel-v320def125bc51ce01dfbf4e676f72901e2cc73d81.json
> cwd: //home/~/testproj
11:10:34.941 [debug] Kernel process undefined.
11:10:34.945 [error] Kernel died [Error: spawn /pyenv/3.12/bin/python ENOENT
at ChildProcess._handle.onexit (node:internal/child_process:286:19)
at onErrorNT (node:internal/child_process:484:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)] {
errno: -2,
code: 'ENOENT',
syscall: 'spawn /pyenv/3.12/bin/python',
path: '/pyenv/3.12/bin/python',
spawnargs: [
'-m',
'ipykernel_launcher',
'--f=/home/~/.local/share/jupyter/runtime/kernel-v320def125bc51ce01dfbf4e676f72901e2cc73d81.json'
]
}
11:10:34.945 [error] Disposing kernel process due to an error [Error: spawn /pyenv/3.12/bin/python ENOENT
at ChildProcess._handle.onexit (node:internal/child_process:286:19)
at onErrorNT (node:internal/child_process:484:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)] {
errno: -2,
code: 'ENOENT',
syscall: 'spawn /pyenv/3.12/bin/python',
path: '/pyenv/3.12/bin/python',
spawnargs: [
'-m',
'ipykernel_launcher',
'--f=/home/~/.local/share/jupyter/runtime/kernel-v320def125bc51ce01dfbf4e676f72901e2cc73d81.json'
]
}
11:10:34.945 [error]
11:10:34.945 [debug] Dispose Kernel process undefined.
11:10:34.948 [error] Failed to connect raw kernel session: Error: The kernel died. Error: ... View Jupyter [log](command:jupyter.viewOutput) for further details.
11:10:34.948 [error] Failed to connect raw kernel session: Error: The kernel died. Error: ... View Jupyter [log](command:jupyter.viewOutput) for further details.
11:10:34.949 [warn] Failed to shutdown kernel, .jvsc74a57bd0da0c5df3dd3647ad5d4882cd2acf3882f3baa2bd3e4126fcd690f3b43894195a./pyenv/3.12/python./pyenv/3.12/python.-m#ipykernel_launcher [TypeError: Cannot read properties of undefined (reading 'dispose')
at U_.shutdown (/home/~/.vscode/extensions/ms-toolsai.jupyter-2024.10.0-linux-x64/dist/extension.node.js:304:13745)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async W_.shutdown (/home/~/.vscode/extensions/ms-toolsai.jupyter-2024.10.0-linux-x64/dist/extension.node.js:304:22578)]
11:10:34.949 [trace] failed to create IJupyterKernelConnectionSession in kernel, UI Disabled = true [qd [Error]:
at new n (/home/~/.vscode/extensions/ms-toolsai.jupyter-2024.10.0-linux-x64/dist/extension.node.js:98:4480)
at new yl (/home/~/.vscode/extensions/ms-toolsai.jupyter-2024.10.0-linux-x64/dist/extension.node.js:181:16388)
at new qd (/home/~/.vscode/extensions/ms-toolsai.jupyter-2024.10.0-linux-x64/dist/extension.node.js:270:26482)
at Dy.launch (/home/~/.vscode/extensions/ms-toolsai.jupyter-2024.10.0-linux-x64/dist/extension.node.js:301:4)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Error: spawn /pyenv/3.12/bin/python ENOENT
at ChildProcess._handle.onexit (node:internal/child_process:286:19)
at onErrorNT (node:internal/child_process:484:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)] {
category: 'unknown',
isJupyterError: true,
originalException: [Error: spawn /pyenv/3.12/bin/python ENOENT
at ChildProcess._handle.onexit (node:internal/child_process:286:19)
at onErrorNT (node:internal/child_process:484:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)] {
errno: -2,
code: 'ENOENT',
syscall: 'spawn /pyenv/3.12/bin/python',
path: '/pyenv/3.12/bin/python',
spawnargs: [
'-m',
'ipykernel_launcher',
'--f=/home/~/.local/share/jupyter/runtime/kernel-v320def125bc51ce01dfbf4e676f72901e2cc73d81.json'
]
},
kernelConnectionMetadata: n {
kind: 'startUsingPythonInterpreter',
kernelSpec: ld {
specFile: '/home/~/.config/Code/User/globalStorage/ms-toolsai.jupyter/version-2024.10.0/jupyter/kernels/python3123jvsc74a57bd0da0c5df3dd3647ad5d4882cd2acf3882f3baa2bd3e4126fcd690f3b43894195a/kernel.json',
interpreterPath: '/pyenv/3.12/bin/python',
isRegisteredByVSC: 'registeredByNewVersionOfExt',
name: 'python3123jvsc74a57bd0da0c5df3dd3647ad5d4882cd2acf3882f3baa2bd3e4126fcd690f3b43894195a',
argv: [Array],
language: 'python',
executable: 'python',
display_name: '3.12',
metadata: [Object],
env: {},
interrupt_mode: undefined
},
interpreter: { id: 'pyenv/3.12/bin/python', uri: [Zo] },
id: '.jvsc74a57bd0da0c5df3dd3647ad5d4882cd2acf3882f3baa2bd3e4126fcd690f3b43894195a./pyenv/3.12/python./pyenv/3.12/python.-m#ipykernel_launcher'
},
stdErr: '\n\n'
}
11:10:34.950 [warn] Error occurred while trying to start the kernel, options.disableUI=true [qd [Error]:
at new n (/home/~/.vscode/extensions/ms-toolsai.jupyter-2024.10.0-linux-x64/dist/extension.node.js:98:4480)
at new yl (/home/~/.vscode/extensions/ms-toolsai.jupyter-2024.10.0-linux-x64/dist/extension.node.js:181:16388)
at new qd (/home/~/.vscode/extensions/ms-toolsai.jupyter-2024.10.0-linux-x64/dist/extension.node.js:270:26482)
at Dy.launch (/home/~/.vscode/extensions/ms-toolsai.jupyter-2024.10.0-linux-x64/dist/extension.node.js:301:4)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Error: spawn /pyenv/3.12/bin/python ENOENT
at ChildProcess._handle.onexit (node:internal/child_process:286:19)
at onErrorNT (node:internal/child_process:484:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)] {
category: 'unknown',
isJupyterError: true,
originalException: [Error: spawn /pyenv/3.12/bin/python ENOENT
at ChildProcess._handle.onexit (node:internal/child_process:286:19)
at onErrorNT (node:internal/child_process:484:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)] {
errno: -2,
code: 'ENOENT',
syscall: 'spawn /pyenv/3.12/bin/python',
path: '/pyenv/3.12/bin/python',
spawnargs: [
'-m',
'ipykernel_launcher',
'--f=/home/~/.local/share/jupyter/runtime/kernel-v320def125bc51ce01dfbf4e676f72901e2cc73d81.json'
]
},
kernelConnectionMetadata: n {
kind: 'startUsingPythonInterpreter',
kernelSpec: ld {
specFile: '/home/~/.config/Code/User/globalStorage/ms-toolsai.jupyter/version-2024.10.0/jupyter/kernels/python3123jvsc74a57bd0da0c5df3dd3647ad5d4882cd2acf3882f3baa2bd3e4126fcd690f3b43894195a/kernel.json',
interpreterPath: '/pyenv/3.12/bin/python',
isRegisteredByVSC: 'registeredByNewVersionOfExt',
name: 'python3123jvsc74a57bd0da0c5df3dd3647ad5d4882cd2acf3882f3baa2bd3e4126fcd690f3b43894195a',
argv: [Array],
language: 'python',
executable: 'python',
display_name: '3.12',
metadata: [Object],
env: {},
interrupt_mode: undefined
},
interpreter: { id: 'pyenv/3.12/bin/python', uri: [Zo] },
id: '.jvsc74a57bd0da0c5df3dd3647ad5d4882cd2acf3882f3baa2bd3e4126fcd690f3b43894195a./pyenv/3.12/python./pyenv/3.12/python.-m#ipykernel_launcher'
},
stdErr: '\n\n'
}
11:10:34.959 [debug] Disposed Kernel process undefined.
I do not know what all the above means. But, in case it matters, my list of Python interpreters is currently littered with duplicates due to my efforts to resolve another issue:
Upon further investigation, the UI behavior described above is due to a bug/confusing feature in the Python extension. See this comment. Once I figured out the correct interpreter entry to select, I get the right results:
As noted in that other comment: this is just a bit confusing for us poor users who are not intimately familiar with the code in these areas.
The following logs appear: still plenty of errors.
Visual Studio Code (1.95.0, undefined, desktop)
Jupyter Extension Version: 2024.10.0.
Python Extension Version: 2024.18.0.
Pylance Extension Version: 2024.10.1.
Platform: linux (x64).
Temp Storage folder ~/.config/Code/User/globalStorage/ms-toolsai.jupyter/version-2024.10.0
Workspace folder ~/testproj, Home = /home/paul
11:49:21.506 [debug] Start refreshing Kernel Picker (1730486961506)
11:49:22.626 [trace] Kernel Spec for 'Python 3 (ipykernel)' (~/.local/share/jupyter/kernels/python3/kernel.json) is hidden. (isDefaultKernelSpec = true, language = python, registrationInfo = undefined)
11:49:22.626 [debug] Get Custom Env Variables, Class name = Em, completed in 1121ms, has a truthy return value, Arg 1: undefined, Arg 2: "RunPythonCode"
11:49:22.626 [debug] Jupyter Paths /kernels:
11:49:22.627 [debug] Kernel Spec Root Paths, /usr/share/jupyter/kernels, /usr/local/share/jupyter/kernels, ~/.local/share/jupyter/kernels
11:49:22.694 [debug] End refreshing Kernel Picker (1730486961506)
11:49:22.698 [trace] Python API env change detected, add => '/home/~/pyenv/3.12/bin/python'
11:49:22.699 [trace] Search for KernelSpecs in Interpreter ~/pyenv/3.12/bin/python
11:49:22.699 [debug] Start refreshing Kernel Picker (1730486962699)
11:49:22.707 [trace] Python API env change detected, add => 'pyenv/3.12/bin/python'
11:49:22.707 [trace] Search for KernelSpecs in Interpreter /pyenv/3.12/bin/python
11:49:23.171 [trace] Hiding default KernelSpec /python for interpreter ~/pyenv/3.12/bin/python (KernelSpec file ~/pyenv/3.12/share/jupyter/kernels/python3/kernel.json)
11:49:23.171 [debug] End refreshing Kernel Picker (1730486962699)
11:49:23.198 [trace] Python API env change detected, add => '/bin/python3'
11:49:23.198 [trace] Search for KernelSpecs in Interpreter /bin/python3
11:49:23.198 [debug] Start refreshing Kernel Picker (1730486963198)
11:49:23.202 [debug] End refreshing Kernel Picker (1730486963198)
11:49:23.212 [trace] Python API env change detected, add => '/usr/bin/python3'
11:49:23.212 [trace] Search for KernelSpecs in Interpreter /usr/bin/python3
11:49:23.213 [debug] Start refreshing Kernel Picker (1730486963213)
11:49:23.220 [trace] Conda file is conda
11:49:23.223 [debug] End refreshing Kernel Picker (1730486963213)
11:49:23.228 [trace] Python API env change detected, update => 'pyenv/3.12/bin/python'
11:49:23.228 [trace] Search for KernelSpecs in Interpreter /pyenv/3.12/bin/python
11:49:23.228 [debug] Start refreshing Kernel Picker (1730486963228)
11:49:23.233 [trace] Hiding default KernelSpec /python for interpreter ~/pyenv/3.12/bin/python (KernelSpec file ~/pyenv/3.12/share/jupyter/kernels/python3/kernel.json)
11:49:23.255 [debug] End refreshing Kernel Picker (1730486963228)
11:49:27.894 [debug] KernelProvider switched kernel to id = .jvsc74a57bd0da0c5df3dd3647ad5d4882cd2acf3882f3baa2bd3e4126fcd690f3b43894195a./pyenv/3.12/python./pyenv/3.12/python.-m#ipykernel_launcher
11:49:27.895 [debug] start the kernel, options.disableUI=true for ~/testproj/Test3.ipynb
11:49:27.947 [trace] Registering commtarget jupyter.widget
11:49:27.948 [debug] Controller selection change completed
11:49:27.950 [debug] Get Custom Env Variables, Class name = Em, completed in 0ms, has a truthy return value, Arg 1: "~/testproj", Arg 2: "RunPythonCode"
11:49:27.951 [info] Starting Kernel (Python Path: /pyenv/3.12/bin/python, Venv, 3.12.3) for '~/testproj/Test3.ipynb' (disableUI=true)
11:49:27.952 [trace] Creating raw notebook for resource '~/testproj/Test3.ipynb'
11:49:27.964 [debug] Get Custom Env Variables, Class name = Em, completed in 0ms, has a truthy return value, Arg 1: "~/testproj/Test3.ipynb", Arg 2: "RunPythonCode"
11:49:27.974 [debug] Got env vars from Python Ext in 24ms for /pyenv/3.12/bin/python, with env var count 60.
11:49:27.975 [trace] Prepend PATH with python bin for /pyenv/3.12/bin/python
11:49:27.975 [debug] Getting activated env variables, Class name = Id, completed in 25ms, has a truthy return value, Arg 1: "~/testproj", Arg 2: "pyenv/3.12/bin/python", Arg 3: undefined
11:49:27.982 [info] Process Execution: /pyenv/3.12/bin/python -m pip list
11:49:27.987 [debug] Got env vars from Python Ext in 23ms for /pyenv/3.12/bin/python, with env var count 60.
11:49:27.987 [trace] Prepend PATH with python bin for /pyenv/3.12/bin/python
11:49:27.987 [debug] Getting activated env variables, Class name = Id, completed in 23ms, has a truthy return value, Arg 1: "~/testproj/Test3.ipynb", Arg 2: "pyenv/3.12/bin/python", Arg 3: undefined
11:49:27.993 [info] Process Execution: /pyenv/3.12/bin/python -c "import ipykernel; print(ipykernel.__version__); print("5dc3a68c-e34e-4080-9c3e-2a532b2ccb4d"); print(ipykernel.__file__)"
11:49:27.995 [debug] Launching kernel .jvsc74a57bd0da0c5df3dd3647ad5d4882cd2acf3882f3baa2bd3e4126fcd690f3b43894195a./pyenv/3.12/python./pyenv/3.12/python.-m#ipykernel_launcher for ~/testproj/Test3.ipynb in //home/~/testproj with ports 9001, 9000, 9004, 9002, 9003
11:49:28.004 [info] Process Execution: /pyenv/3.12/bin/python -m ipykernel_launcher --f=/home/~/.local/share/jupyter/runtime/kernel-v3852f403cbd7b9b9cc7c812c3dd9c794abd5fdc46.json
> cwd: //home/~/testproj
11:49:28.004 [debug] Kernel process undefined.
11:49:28.009 [error] Kernel died [Error: spawn /pyenv/3.12/bin/python ENOENT
at ChildProcess._handle.onexit (node:internal/child_process:286:19)
at onErrorNT (node:internal/child_process:484:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)] {
errno: -2,
code: 'ENOENT',
syscall: 'spawn /pyenv/3.12/bin/python',
path: '/pyenv/3.12/bin/python',
spawnargs: [
'-m',
'ipykernel_launcher',
'--f=/home/~/.local/share/jupyter/runtime/kernel-v3852f403cbd7b9b9cc7c812c3dd9c794abd5fdc46.json'
]
}
11:49:28.009 [error] Disposing kernel process due to an error [Error: spawn /pyenv/3.12/bin/python ENOENT
at ChildProcess._handle.onexit (node:internal/child_process:286:19)
at onErrorNT (node:internal/child_process:484:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)] {
errno: -2,
code: 'ENOENT',
syscall: 'spawn /pyenv/3.12/bin/python',
path: '/pyenv/3.12/bin/python',
spawnargs: [
'-m',
'ipykernel_launcher',
'--f=/home/~/.local/share/jupyter/runtime/kernel-v3852f403cbd7b9b9cc7c812c3dd9c794abd5fdc46.json'
]
}
11:49:28.009 [error]
11:49:28.009 [debug] Dispose Kernel process undefined.
11:49:28.012 [error] Failed to connect raw kernel session: Error: The kernel died. Error: ... View Jupyter [log](command:jupyter.viewOutput) for further details.
11:49:28.013 [error] Failed to connect raw kernel session: Error: The kernel died. Error: ... View Jupyter [log](command:jupyter.viewOutput) for further details.
11:49:28.013 [warn] Failed to shutdown kernel, .jvsc74a57bd0da0c5df3dd3647ad5d4882cd2acf3882f3baa2bd3e4126fcd690f3b43894195a./pyenv/3.12/python./pyenv/3.12/python.-m#ipykernel_launcher [TypeError: Cannot read properties of undefined (reading 'dispose')
at U_.shutdown (/home/~/.vscode/extensions/ms-toolsai.jupyter-2024.10.0-linux-x64/dist/extension.node.js:304:13745)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async W_.shutdown (/home/~/.vscode/extensions/ms-toolsai.jupyter-2024.10.0-linux-x64/dist/extension.node.js:304:22578)]
11:49:28.013 [trace] failed to create IJupyterKernelConnectionSession in kernel, UI Disabled = true [qd [Error]:
at new n (/home/~/.vscode/extensions/ms-toolsai.jupyter-2024.10.0-linux-x64/dist/extension.node.js:98:4480)
at new yl (/home/~/.vscode/extensions/ms-toolsai.jupyter-2024.10.0-linux-x64/dist/extension.node.js:181:16388)
at new qd (/home/~/.vscode/extensions/ms-toolsai.jupyter-2024.10.0-linux-x64/dist/extension.node.js:270:26482)
at Dy.launch (/home/~/.vscode/extensions/ms-toolsai.jupyter-2024.10.0-linux-x64/dist/extension.node.js:301:4)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Error: spawn /pyenv/3.12/bin/python ENOENT
at ChildProcess._handle.onexit (node:internal/child_process:286:19)
at onErrorNT (node:internal/child_process:484:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)] {
category: 'unknown',
isJupyterError: true,
originalException: [Error: spawn /pyenv/3.12/bin/python ENOENT
at ChildProcess._handle.onexit (node:internal/child_process:286:19)
at onErrorNT (node:internal/child_process:484:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)] {
errno: -2,
code: 'ENOENT',
syscall: 'spawn /pyenv/3.12/bin/python',
path: '/pyenv/3.12/bin/python',
spawnargs: [
'-m',
'ipykernel_launcher',
'--f=/home/~/.local/share/jupyter/runtime/kernel-v3852f403cbd7b9b9cc7c812c3dd9c794abd5fdc46.json'
]
},
kernelConnectionMetadata: n {
kind: 'startUsingPythonInterpreter',
kernelSpec: ld {
specFile: '/home/~/.config/Code/User/globalStorage/ms-toolsai.jupyter/version-2024.10.0/jupyter/kernels/python3123jvsc74a57bd0da0c5df3dd3647ad5d4882cd2acf3882f3baa2bd3e4126fcd690f3b43894195a/kernel.json',
interpreterPath: '/pyenv/3.12/bin/python',
isRegisteredByVSC: 'registeredByNewVersionOfExt',
name: 'python3123jvsc74a57bd0da0c5df3dd3647ad5d4882cd2acf3882f3baa2bd3e4126fcd690f3b43894195a',
argv: [Array],
language: 'python',
executable: 'python',
display_name: '3.12',
metadata: [Object],
env: {},
interrupt_mode: undefined
},
interpreter: { id: 'pyenv/3.12/bin/python', uri: [Zo] },
id: '.jvsc74a57bd0da0c5df3dd3647ad5d4882cd2acf3882f3baa2bd3e4126fcd690f3b43894195a./pyenv/3.12/python./pyenv/3.12/python.-m#ipykernel_launcher'
},
stdErr: '\n\n'
}
11:49:28.014 [warn] Error occurred while trying to start the kernel, options.disableUI=true [qd [Error]:
at new n (/home/~/.vscode/extensions/ms-toolsai.jupyter-2024.10.0-linux-x64/dist/extension.node.js:98:4480)
at new yl (/home/~/.vscode/extensions/ms-toolsai.jupyter-2024.10.0-linux-x64/dist/extension.node.js:181:16388)
at new qd (/home/~/.vscode/extensions/ms-toolsai.jupyter-2024.10.0-linux-x64/dist/extension.node.js:270:26482)
at Dy.launch (/home/~/.vscode/extensions/ms-toolsai.jupyter-2024.10.0-linux-x64/dist/extension.node.js:301:4)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Error: spawn /pyenv/3.12/bin/python ENOENT
at ChildProcess._handle.onexit (node:internal/child_process:286:19)
at onErrorNT (node:internal/child_process:484:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)] {
category: 'unknown',
isJupyterError: true,
originalException: [Error: spawn /pyenv/3.12/bin/python ENOENT
at ChildProcess._handle.onexit (node:internal/child_process:286:19)
at onErrorNT (node:internal/child_process:484:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)] {
errno: -2,
code: 'ENOENT',
syscall: 'spawn /pyenv/3.12/bin/python',
path: '/pyenv/3.12/bin/python',
spawnargs: [
'-m',
'ipykernel_launcher',
'--f=/home/~/.local/share/jupyter/runtime/kernel-v3852f403cbd7b9b9cc7c812c3dd9c794abd5fdc46.json'
]
},
kernelConnectionMetadata: n {
kind: 'startUsingPythonInterpreter',
kernelSpec: ld {
specFile: '/home/~/.config/Code/User/globalStorage/ms-toolsai.jupyter/version-2024.10.0/jupyter/kernels/python3123jvsc74a57bd0da0c5df3dd3647ad5d4882cd2acf3882f3baa2bd3e4126fcd690f3b43894195a/kernel.json',
interpreterPath: '/pyenv/3.12/bin/python',
isRegisteredByVSC: 'registeredByNewVersionOfExt',
name: 'python3123jvsc74a57bd0da0c5df3dd3647ad5d4882cd2acf3882f3baa2bd3e4126fcd690f3b43894195a',
argv: [Array],
language: 'python',
executable: 'python',
display_name: '3.12',
metadata: [Object],
env: {},
interrupt_mode: undefined
},
interpreter: { id: 'pyenv/3.12/bin/python', uri: [Zo] },
id: '.jvsc74a57bd0da0c5df3dd3647ad5d4882cd2acf3882f3baa2bd3e4126fcd690f3b43894195a./pyenv/3.12/python./pyenv/3.12/python.-m#ipykernel_launcher'
},
stdErr: '\n\n'
}
11:49:28.021 [debug] Disposed Kernel process undefined.
OK, after even more fiddling, I found something that will get past the above errors. DO NOT USE Venv Folders
. IT IS EVIL. (See the issue referenced above.) Instead, just use the Venv Path
setting to configure a virtual environment.
Now, the only glitch is that the first notebook created has a different Select Kernel
flow than the second one created.
First one:
Select Kernel
Python Environments...
and select the virtual environment.Visual Studio Code (1.95.0, undefined, desktop)
Jupyter Extension Version: 2024.10.0.
Python Extension Version: 2024.18.0.
Pylance Extension Version: 2024.10.1.
Platform: linux (x64).
Temp Storage folder ~/.config/Code/User/globalStorage/ms-toolsai.jupyter/version-2024.10.0
Workspace folder ~/testproj, Home = /home/paul
12:17:13.211 [debug] Start refreshing Kernel Picker (1730488633211)
12:17:14.490 [trace] Search for KernelSpecs in Interpreter ~/pyenv/3.12/bin/python
12:17:14.491 [trace] Search for KernelSpecs in Interpreter /usr/bin/python3
12:17:14.491 [trace] Search for KernelSpecs in Interpreter /bin/python3
12:17:14.492 [trace] Kernel Spec for 'Python 3 (ipykernel)' (~/.local/share/jupyter/kernels/python3/kernel.json) is hidden. (isDefaultKernelSpec = true, language = python, registrationInfo = undefined)
12:17:14.493 [debug] Get Custom Env Variables, Class name = Em, completed in 1283ms, has a truthy return value, Arg 1: undefined, Arg 2: "RunPythonCode"
12:17:14.493 [debug] Jupyter Paths /kernels:
12:17:14.494 [debug] Kernel Spec Root Paths, /usr/share/jupyter/kernels, /usr/local/share/jupyter/kernels, ~/.local/share/jupyter/kernels
12:17:14.529 [trace] Hiding default KernelSpec /python for interpreter ~/pyenv/3.12/bin/python (KernelSpec file ~/pyenv/3.12/share/jupyter/kernels/python3/kernel.json)
12:17:14.529 [debug] End refreshing Kernel Picker (1730488633211)
12:17:14.534 [trace] Python API env change detected, update => '/home/~/pyenv/3.12/bin/python'
12:17:14.534 [trace] Search for KernelSpecs in Interpreter ~/pyenv/3.12/bin/python
12:17:14.534 [debug] Start refreshing Kernel Picker (1730488634534)
12:17:14.536 [trace] Hiding default KernelSpec /python for interpreter ~/pyenv/3.12/bin/python (KernelSpec file ~/pyenv/3.12/share/jupyter/kernels/python3/kernel.json)
12:17:14.537 [debug] End refreshing Kernel Picker (1730488634534)
12:17:15.108 [trace] Conda file is conda
12:17:21.835 [debug] Start refreshing Interpreter Kernel Picker
12:17:21.835 [debug] Start refreshing Kernel Picker (1730488641835)
12:17:21.838 [trace] No controller, hence notebook communications cannot be initialized for editor ~/testproj/Test5.ipynb
12:17:21.853 [trace] Python API env change detected, update => '/home/~/pyenv/3.12/bin/python'
12:17:21.853 [trace] Search for KernelSpecs in Interpreter ~/pyenv/3.12/bin/python
12:17:21.854 [trace] Hiding default KernelSpec /python for interpreter ~/pyenv/3.12/bin/python (KernelSpec file ~/pyenv/3.12/share/jupyter/kernels/python3/kernel.json)
12:17:21.955 [debug] Refreshed Environments
12:17:22.956 [debug] End refreshing Kernel Picker (1730488641835)
12:17:28.317 [debug] KernelProvider switched kernel to id = .jvsc74a57bd049d54976ddc812de6cd3e61a814bfa938ec6d96e5bed8701f21d85baa25c5f8d./home/~/pyenv/3.12/python./home/~/pyenv/3.12/python.-m#ipykernel_launcher
12:17:28.318 [debug] start the kernel, options.disableUI=true for ~/testproj/Test5.ipynb
12:17:28.379 [trace] Registering commtarget jupyter.widget
12:17:28.380 [debug] Controller selection change completed
12:17:28.382 [debug] Get Custom Env Variables, Class name = Em, completed in 0ms, has a truthy return value, Arg 1: "~/testproj", Arg 2: "RunPythonCode"
12:17:28.383 [info] Starting Kernel (Python Path: ~/pyenv/3.12/bin/python, Venv, 3.12.3) for '~/testproj/Test5.ipynb' (disableUI=true)
12:17:28.384 [trace] Creating raw notebook for resource '~/testproj/Test5.ipynb'
12:17:28.394 [debug] Get Custom Env Variables, Class name = Em, completed in 0ms, has a truthy return value, Arg 1: "~/testproj/Test5.ipynb", Arg 2: "RunPythonCode"
12:17:28.409 [debug] Launching kernel .jvsc74a57bd049d54976ddc812de6cd3e61a814bfa938ec6d96e5bed8701f21d85baa25c5f8d./home/~/pyenv/3.12/python./home/~/pyenv/3.12/python.-m#ipykernel_launcher for ~/testproj/Test5.ipynb in //home/~/testproj with ports 9001, 9000, 9004, 9002, 9003
12:17:28.452 [debug] Got env vars from Python Ext in 70ms for ~/pyenv/3.12/bin/python, with env var count 65.
12:17:28.452 [trace] Prepend PATH with python bin for ~/pyenv/3.12/bin/python
12:17:28.453 [debug] Getting activated env variables, Class name = Id, completed in 72ms, has a truthy return value, Arg 1: "~/testproj", Arg 2: "~/pyenv/3.12/bin/python", Arg 3: undefined
12:17:28.461 [info] Process Execution: ~/pyenv/3.12/bin/python -m pip list
12:17:28.462 [debug] Got env vars from Python Ext in 68ms for ~/pyenv/3.12/bin/python, with env var count 65.
12:17:28.462 [trace] Prepend PATH with python bin for ~/pyenv/3.12/bin/python
12:17:28.463 [debug] Getting activated env variables, Class name = Id, completed in 69ms, has a truthy return value, Arg 1: "~/testproj/Test5.ipynb", Arg 2: "~/pyenv/3.12/bin/python", Arg 3: undefined
12:17:28.471 [info] Process Execution: ~/pyenv/3.12/bin/python -c "import ipykernel; print(ipykernel.__version__); print("5dc3a68c-e34e-4080-9c3e-2a532b2ccb4d"); print(ipykernel.__file__)"
12:17:28.479 [info] Process Execution: ~/pyenv/3.12/bin/python -m ipykernel_launcher --f=/home/~/.local/share/jupyter/runtime/kernel-v398330575240a3fc14e25e2a3bbc4581212ce6c4f.json
> cwd: //home/~/testproj
12:17:28.479 [debug] Kernel process 1365181.
12:17:28.649 [trace] ipykernel version & path 6.29.5, ~/pyenv/3.12/lib/python3.12/site-packages/ipykernel/__init__.py for ~/pyenv/3.12/bin/python
12:17:28.862 [debug] Kernel output 1365181: To connect another client to this kernel, use:
--existing kernel-v398330575240a3fc14e25e2a3bbc4581212ce6c4f.json
12:17:28.930 [debug] Waiting for Raw Session to be ready in postStartRawSession
12:17:28.930 [debug] Waiting for Raw session to be ready, status: connected
12:17:28.931 [trace] Raw session connected
12:17:28.931 [debug] Waited for Raw session to be ready & got status: connected
12:17:28.931 [debug] Successfully waited for Raw Session to be ready in postStartRawSession
12:17:28.932 [debug] Kernel status is 'unknown' before requesting kernel info and after ready
12:17:28.932 [debug] Sending request for kernelInfo
12:17:28.946 [trace] Got response for requestKernelInfo
12:17:28.946 [debug] Successfully completed postStartRawSession after 1 attempt(s) in 14ms
12:17:28.948 [trace] Executing silently Code (idle) = import sys as _VSCODE_sys\nprint(_VSCODE_sys.executable); del _VSCODE_sys
12:17:28.954 [trace] Executing silently Code (completed) = import sys as _VSCODE_sys\nprint(_VSCODE_sys.executable); del _VSCODE_sys with 1 output(s)
12:17:28.954 [trace] Started running kernel initialization for ~/testproj/Test5.ipynb
12:17:28.955 [trace] Executing silently Code (idle) = try:\nimport ipywidgets as _VSCODE_ipywidgets\nprint("e976ee50-99ed-4aba-9b6b-9dcd5634d07d:IPy
12:17:29.027 [trace] Executing silently Code (completed) = try:\nimport ipywidgets as _VSCODE_ipywidgets\nprint("e976ee50-99ed-4aba-9b6b-9dcd5634d07d:IPy with 1 output(s)
12:17:29.028 [trace] Determined IPyWidgets Version as 8
12:17:29.028 [trace] Version of IPyWidgets 8 determined after 0.649s
12:17:29.028 [trace] Executing silently Code (idle) = def __VSCODE_inject_module():\ndef __VSCODE_call_function(function, callback, data=None):
12:17:29.041 [trace] Executing silently Code (completed) = def __VSCODE_inject_module():\ndef __VSCODE_call_function(function, callback, data=None): with 0 output(s)
12:17:29.041 [debug] Requesting Kernel info
12:17:29.042 [trace] Got Kernel info
12:17:29.042 [trace] End running kernel initialization, now waiting for idle
12:17:29.042 [trace] Waiting for idle on (kernel): 061916dd-7288-4e45-9cec-e5fb82577432 -> idle
12:17:29.043 [trace] Finished waiting for idle on (kernel): 061916dd-7288-4e45-9cec-e5fb82577432 -> idle
12:17:29.043 [trace] End running kernel initialization, session is idle
12:17:29.044 [trace] Registering Kernel Completion Provider from kernel 3.12 (Python 3.12.3) for language python
12:17:29.045 [trace] IPyWidgetScriptSource.initialize
12:17:29.045 [info] Kernel successfully started
12:17:29.047 [debug] getDataDirsImpl, Class name = Kr (started execution), Arg 1: "~/testproj/Test5.ipynb", Arg 2: "~/pyenv/3.12/bin/python"
12:17:29.049 [debug] Get Custom Env Variables, Class name = Em, completed in 1ms, has a truthy return value, Arg 1: undefined, Arg 2: "RunPythonCode"
12:17:29.049 [debug] Jupyter Paths :
12:17:29.056 [info] Process Execution: ~/pyenv/3.12/bin/python /home/~/.vscode/extensions/ms-toolsai.jupyter-2024.10.0-linux-x64/pythonFiles/printJupyterDataDir.py
12:17:29.071 [debug] Got an empty Jupyter Data Dir from /home/~/pyenv/3.12/bin/python, stderr = undefined
12:17:29.071 [debug] getDataDirsImpl, Class name = Kr, completed in 24ms, has a truthy return value, Arg 1: "~/testproj/Test5.ipynb", Arg 2: "~/pyenv/3.12/bin/python", Return Value: <Uri:/home/~/.local/share/jupyter>, <Uri:/home/~/pyenv/3.12/share/jupyter>, <Uri:/usr/local/share/jupyter>, <Uri:/usr/share/jupyter>
12:17:29.604 [trace] Web view is ready to receive widget messages
12:17:29.610 [trace] Widget Message: Received IPyWidgets_kernelOptions in ScriptManager
12:17:29.610 [trace] Widget Message: Received IPyWidgetMessages.IPyWidgets_kernelOptions
12:17:29.637 [trace] Widget Message: data-base-url set to https://file%2B.vscode-resource.vscode-cdn.net/home/~/.vscode/extensions/ms-toolsai.jupyter-2024.10.0-linux-x64/temp/scripts/3dfd2dcd0d9d2f80dc8f74f21e91acfd6ab2bb43b0f00ff8e4ffbf91ebee2adc/jupyter
12:17:29.637 [trace] Widget Message: Received IPyWidgets_kernelOptions in ScriptManager
12:17:29.637 [trace] Widget Message: Received IPyWidgetMessages.IPyWidgets_kernelOptions
12:17:29.638 [trace] Widget Message: data-base-url set to https://file%2B.vscode-resource.vscode-cdn.net/home/~/.vscode/extensions/ms-toolsai.jupyter-2024.10.0-linux-x64/temp/scripts/3dfd2dcd0d9d2f80dc8f74f21e91acfd6ab2bb43b0f00ff8e4ffbf91ebee2adc/jupyter
12:17:29.640 [trace] Widget Message: Received IPyWidget scripts [{"moduleName":"jupyter-matplotlib","scriptUri":"https://file%2B.vscode-resource.vscode-cdn.net/home/~/.vscode/extensions/ms-toolsai.jupyter-2024.10.0-linux-x64/temp/scripts/3dfd2dcd0d9d2f80dc8f74f21e91acfd6ab2bb43b0f00ff8e4ffbf91ebee2adc/jupyter/nbextensions/jupyter-matplotlib/index","source":"local"}]
12:17:29.640 [trace] Widget Message: Source for IPyWidget jupyter-matplotlib found in local @ https://file%2B.vscode-resource.vscode-cdn.net/home/~/.vscode/extensions/ms-toolsai.jupyter-2024.10.0-linux-x64/temp/scripts/3dfd2dcd0d9d2f80dc8f74f21e91acfd6ab2bb43b0f00ff8e4ffbf91ebee2adc/jupyter/nbextensions/jupyter-matplotlib/index.
12:17:29.640 [trace] Widget Message: Registering IPyWidget jupyter-matplotlib found in https://file%2B.vscode-resource.vscode-cdn.net/home/~/.vscode/extensions/ms-toolsai.jupyter-2024.10.0-linux-x64/temp/scripts/3dfd2dcd0d9d2f80dc8f74f21e91acfd6ab2bb43b0f00ff8e4ffbf91ebee2adc/jupyter/nbextensions/jupyter-matplotlib/index.
Second one:
Select Kernel
Now we can move onto reproducing the actual DISPOSED
error. As it turns out, I cannot reproduce it once I stopped using the Venv Folders
setting to configure my virtual environment, and instead used Venv Path
. In a new Notebook:
def loop():
while True:
pass
loop()
x = 10
inside the function.The logs indicate no problem. Recall that this is simplified version of the scenario described in this bug. With a properly-configured interpreter, the DISPOSED
error does not occur.
I don't have the time to repeat this using the broken Venv Folders
setting, but I'd bet that the problem is due to the use of that setting.
To see if the use of Venv Path
fixes the original problem, I reopened my project. The Jupyter logs contained no error, but it does contain the following odd line:
12:32:22.767 [debug] Refreshed Environments
12:32:22.772 [trace] Python API env change detected, update => '/home/~/pyenv/3.12/bin/python'
What is odd is that /home/~/pyenv/...
is not a valid Linux path. A valid path (before expansion) would be ~/pyenv/...
or (after expansion) /home/paul/pyenv/...
. Maybe this is just a cosmetic issue: the rest of the logs look clean and things do work.
I then recreated the infinite loop mentioned before. (The code had since been fixed.) I then recreated the scenario described above. No errors appeared in the notebook or in the logs.
My conclusion is that the DISPOSED
error was a side effect of the evil Venv Folders
setting. As I suggested in the other issue: do not use this setting. Use Venv Path
instead and life will be much easier.
Than you for getting back, closing this issue as its been fixed
Type: Bug
A notebook is open with a Python kernel. I was working on code for some hours. Nothing particularly special or large: just a around 20 cells, a few hundred lines of code, some Markdown and one MatPlotLib chart. Edited a Python cell containing a function declaration and ran it. Got a red error under the cell that says:
The one thing I did wrong is that I edited the cell and ran it while a debug session was still active on that same cell. Usually this just redefines the function (which, obviously, is rather goofy on my part), but usually if I make this mistake all is fine when I end the debug session. This is the first time I've seen the above error.
There does not seem to be permanent damage. If I end the debug session, rerun the function definition cell and continue working, it seems that things are back to normal. So, this is some temporary glitch that can, apparently, be ignored.
The word "log" in the message above is a link. Clicking on that opens the log with the following:
Extension version: 2024.10.0 VS Code version: Code 1.95.0 (912bb683695358a54ae0c670461738984cbb5b95, 2024-10-28T20:16:24.561Z) OS version: Linux x64 6.8.0-47-generic Modes:
System Info
|Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i7-2600K CPU @ 3.40GHz (8 x 4429)| |GPU Status|2d_canvas: enabledcanvas_oop_rasterization: enabled_on
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
video_decode: enabled
video_encode: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
webnn: disabled_off| |Load (avg)|1, 1, 1| |Memory (System)|31.31GB (6.16GB free)| |Process Argv|--crash-reporter-id 5e232e7b-355a-468c-ac4a-02c300f898bd| |Screen Reader|no| |VM|0%| |DESKTOP_SESSION|cinnamon| |XDG_CURRENT_DESKTOP|X-Cinnamon| |XDG_SESSION_DESKTOP|cinnamon| |XDG_SESSION_TYPE|x11|
A/B Experiments
``` vsliv368cf:30146710 vspor879:30202332 vspor708:30202333 vspor363:30204092 vscod805:30301674 binariesv615:30325510 vsaa593:30376534 py29gd2263:31024239 c4g48928:30535728 azure-dev_surveyone:30548225 a9j8j154:30646983 962ge761:30959799 pythongtdpath:30769146 pythonnoceb:30805159 asynctok:30898717 pythonmypyd1:30879173 h48ei257:31000450 pythontbext0:30879054 cppperfnew:31000557 dsvsc020:30976470 pythonait:31006305 dsvsc021:30996838 g316j359:31013175 dvdeprecation:31068756 dwnewjupytercf:31046870 2f103344:31071589 impr_priority:31102340 nativerepl1:31139838 refactort:31108082 pythonrstrctxt:31112756 wkspc-onlycs-t:31132770 nativeloc1:31134641 wkspc-ranged-t:31151552 cf971741:31144450 iacca1:31156133 notype1cf:31157160 5fd0e150:31155592 dwcopilot:31170013 ```