Skip to content

Unable to run notebook cells with spaces in path #17042

@dakenblack

Description

@dakenblack

VSCode does not recognise ipykernel package within virtual environment. the issue is fixed by using an older version of the jupyter extension (2025.8.0).

Environment data

  • Jupyter Extension version (available under the Extensions sidebar): 2025.9.0 (it works with 2025.8.0)
  • Python Extension version (available under the Extensions sidebar): 2025.16.0
  • Python and/or Anaconda version: 3.13
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): venv
  • Jupyter server running: Local | Remote | N/A

System:
Image

ipykernel==6.30.1 is installed in local venv.

Expected behaviour

Notebook executes

Actual behaviour

I get an error message:

Image

If I click "Install" I get this error message in the output section of the jupyter cell:
Image

Steps to reproduce:

Try to execute on empty notebook.

Logs

Output for Jupyter in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Jupyter)

14:07:57.089 [info] Starting Kernel (Python Path: ~\Documents\Projects\003 Data Projects\jw-parsers\.venv\Scripts\python.exe, Venv, 3.13.5) for '~\Documents\Projects\003 Data Projects\jw-parsers\experiments\20251010 asx\00 explore.ipynb' (disableUI=false)
14:07:57.092 [info] Process Execution: ~\Documents\Projects\003 Data Projects\jw-parsers\.venv\Scripts\python.exe -c "import ipykernel; print(ipykernel.__version__); print("5dc3a68c-e34e-4080-9c3e-2a532b2ccb4d"); print(ipykernel.__file__)"
14:07:57.166 [info] Process Execution: ~\Documents\Projects\003 Data Projects\jw-parsers\.venv\Scripts\python.exe -m ipykernel_launcher --f=~\AppData\Roaming\jupyter\runtime\kernel-v3d077834aba04cafb6fa7aea82b801dfdb3413a94.json
    > cwd: ~\Documents\Projects\003 Data Projects\jw-parsers\experiments\20251010 asx
14:07:57.166 [error] Kernel died Error: spawn "c:/<username>s/<username>/Documents/Projects/003 Data Projects/jw-parsers/.venv/Scripts/python.exe" ENOENT
    at Process.ChildProcess._handle.onexit (node:internal/child_process:285:19)
    at onErrorNT (node:internal/child_process:483:16)
    at processTicksAndRejections (node:internal/process/task_queues:90:21) {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'spawn "c:/<username>s/<username>/Documents/Projects/003 Data Projects/jw-parsers/.venv/Scripts/python.exe"',
  path: '"c:/<username>s/<username>/Documents/Projects/003 Data Projects/jw-parsers/.venv/Scripts/python.exe"',
  spawnargs: [
    '-m',
    'ipykernel_launcher',
    '--f=c:\\<username>s\\<username>\\AppData\\Roaming\\jupyter\\runtime\\kernel-v3d077834aba04cafb6fa7aea82b801dfdb3413a94.json'
  ]
} 
14:07:57.166 [error] Disposing kernel process due to an error Error: spawn "c:/<username>s/<username>/Documents/Projects/003 Data Projects/jw-parsers/.venv/Scripts/python.exe" ENOENT
    at Process.ChildProcess._handle.onexit (node:internal/child_process:285:19)
    at onErrorNT (node:internal/child_process:483:16)
    at processTicksAndRejections (node:internal/process/task_queues:90:21) {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'spawn "c:/<username>s/<username>/Documents/Projects/003 Data Projects/jw-parsers/.venv/Scripts/python.exe"',
  path: '"c:/<username>s/<username>/Documents/Projects/003 Data Projects/jw-parsers/.venv/Scripts/python.exe"',
  spawnargs: [
    '-m',
    'ipykernel_launcher',
    '--f=c:\\<username>s\\<username>\\AppData\\Roaming\\jupyter\\runtime\\kernel-v3d077834aba04cafb6fa7aea82b801dfdb3413a94.json'
  ]
}
14:07:57.166 [error] 
14:07:57.167 [error] Failed to connect raw kernel session: Error: The kernel died. Error: ... View Jupyter [log](command:jupyter.viewOutput) for further details.
14:07:57.167 [error] Failed to connect raw kernel session: Error: The kernel died. Error: ... View Jupyter [log](command:jupyter.viewOutput) for further details.
14:07:57.167 [warn] Failed to shutdown kernel, .jvsc74a57bd0afc3510e580656b4ec2b0df362b50f8521590f26e05bf80bb6ecadd8772d063d.~\Documents\Projects\003 Data Projects\jw-parsers\.venv\Scripts\python.exe.~\Documents\Projects\003 Data Projects\jw-parsers\.venv\Scripts\python.exe.-m#ipykernel_launcher TypeError: Cannot read properties of undefined (reading 'dispose')
    at JT.shutdown (~\.vscode\extensions\ms-toolsai.jupyter-2025.9.0-win32-x64\dist\extension.node.js:309:13632)
    at processTicksAndRejections (node:internal/process/task_queues:105:5)
    at qT.shutdown (~\.vscode\extensions\ms-toolsai.jupyter-2025.9.0-win32-x64\dist\extension.node.js:309:22453)
14:07:57.168 [warn] Error occurred while trying to start the kernel, options.disableUI=false Error: The kernel died. Error: ... View Jupyter [log](command:jupyter.viewOutput) for further details.
    > Kernel Id = .jvsc74a57bd0afc3510e580656b4ec2b0df362b50f8521590f26e05bf80bb6ecadd8772d063d.~\Documents\Projects\003 Data Projects\jw-parsers\.venv\Scripts\python.exe.~\Documents\Projects\003 Data Projects\jw-parsers\.venv\Scripts\python.exe.-m#ipykernel_launcher
    > Interpreter Id = ~\Documents\Projects\003 Data Projects\jw-parsers\.venv\Scripts\python.exe
    > at new n (~\.vscode\extensions\ms-toolsai.jupyter-2025.9.0-win32-x64\dist\extension.node.js:62:51941)
    > originalException = Error: spawn "c:/<username>s/<username>/Documents/Projects/003 Data Projects/jw-parsers/.venv/Scripts/python.exe" ENOENT
    > stdErr = 
14:07:57.168 [warn] Kernel Error, context = start Error: The kernel died. Error: ... View Jupyter [log](command:jupyter.viewOutput) for further details.
    > Kernel Id = .jvsc74a57bd0afc3510e580656b4ec2b0df362b50f8521590f26e05bf80bb6ecadd8772d063d.~\Documents\Projects\003 Data Projects\jw-parsers\.venv\Scripts\python.exe.~\Documents\Projects\003 Data Projects\jw-parsers\.venv\Scripts\python.exe.-m#ipykernel_launcher
    > Interpreter Id = ~\Documents\Projects\003 Data Projects\jw-parsers\.venv\Scripts\python.exe
    > at new n (~\.vscode\extensions\ms-toolsai.jupyter-2025.9.0-win32-x64\dist\extension.node.js:62:51941)
    > originalException = Error: spawn "c:/<username>s/<username>/Documents/Projects/003 Data Projects/jw-parsers/.venv/Scripts/python.exe" ENOENT
    > stdErr = 
14:07:57.170 [info] Process Execution: ~\Documents\Projects\003 Data Projects\jw-parsers\.venv\Scripts\python.exe -c "import ipykernel;print('6af208d0-cb9c-427f-b937-ff563e17efdf')"
14:07:57.170 [warn] Module ipykernel not installed in environment ~\Documents\Projects\003 Data Projects\jw-parsers\.venv\Scripts\python.exe Error: spawn "c:/<username>s/<username>/Documents/Projects/003 Data Projects/jw-parsers/.venv/Scripts/python.exe" ENOENT
    at Process.ChildProcess._handle.onexit (node:internal/child_process:285:19)
    at onErrorNT (node:internal/child_process:483:16)
    at processTicksAndRejections (node:internal/process/task_queues:90:21) {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'spawn "c:/<username>s/<username>/Documents/Projects/003 Data Projects/jw-parsers/.venv/Scripts/python.exe"',
  path: '"c:/<username>s/<username>/Documents/Projects/003 Data Projects/jw-parsers/.venv/Scripts/python.exe"',
  spawnargs: [
    '-c',
    "import ipykernel;print('6af208d0-cb9c-427f-b937-ff563e17efdf')"
  ]
}
14:07:57.171 [info] Check & install missing Kernel dependencies for ~\Documents\Projects\003 Data Projects\jw-parsers\.venv\Scripts\python.exe, ui.disabled=false for resource '~\Documents\Projects\003 Data Projects\jw-parsers\experiments\20251010 asx\00 explore.ipynb'
14:07:57.172 [info] Process Execution: ~\Documents\Projects\003 Data Projects\jw-parsers\.venv\Scripts\python.exe -c "import ipykernel;print('6af208d0-cb9c-427f-b937-ff563e17efdf')"
14:07:57.172 [warn] Module ipykernel not installed in environment ~\Documents\Projects\003 Data Projects\jw-parsers\.venv\Scripts\python.exe Error: spawn "c:/<username>s/<username>/Documents/Projects/003 Data Projects/jw-parsers/.venv/Scripts/python.exe" ENOENT
    at Process.ChildProcess._handle.onexit (node:internal/child_process:285:19)
    at onErrorNT (node:internal/child_process:483:16)
    at processTicksAndRejections (node:internal/process/task_queues:90:21) {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'spawn "c:/<username>s/<username>/Documents/Projects/003 Data Projects/jw-parsers/.venv/Scripts/python.exe"',
  path: '"c:/<username>s/<username>/Documents/Projects/003 Data Projects/jw-parsers/.venv/Scripts/python.exe"',
  spawnargs: [
    '-c',
    "import ipykernel;print('6af208d0-cb9c-427f-b937-ff563e17efdf')"
  ]
}
14:07:57.173 [info] Process Execution: ~\Documents\Projects\003 Data Projects\jw-parsers\.venv\Scripts\python.exe -c "import pip;print('6af208d0-cb9c-427f-b937-ff563e17efdf')"
14:07:57.173 [warn] Module pip not installed in environment ~\Documents\Projects\003 Data Projects\jw-parsers\.venv\Scripts\python.exe Error: spawn "c:/<username>s/<username>/Documents/Projects/003 Data Projects/jw-parsers/.venv/Scripts/python.exe" ENOENT
    at Process.ChildProcess._handle.onexit (node:internal/child_process:285:19)
    at onErrorNT (node:internal/child_process:483:16)
    at processTicksAndRejections (node:internal/process/task_queues:90:21) {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'spawn "c:/<username>s/<username>/Documents/Projects/003 Data Projects/jw-parsers/.venv/Scripts/python.exe"',
  path: '"c:/<username>s/<username>/Documents/Projects/003 Data Projects/jw-parsers/.venv/Scripts/python.exe"',
  spawnargs: [ '-c', "import pip;print('6af208d0-cb9c-427f-b937-ff563e17efdf')" ]
}
14:07:59.941 [info] Dispose Kernel '~\Documents\Projects\003 Data Projects\jw-parsers\experiments\20251010 asx\00 explore.ipynb' associated with '~\Documents\Projects\003 Data Projects\jw-parsers\experiments\20251010 asx\00 explore.ipynb'
14:07:59.942 [error] Error in notebook cell execution Error: The kernel died. Error: ... View Jupyter [log](command:jupyter.viewOutput) for further details.
    > Kernel Id = .jvsc74a57bd0afc3510e580656b4ec2b0df362b50f8521590f26e05bf80bb6ecadd8772d063d.~\Documents\Projects\003 Data Projects\jw-parsers\.venv\Scripts\python.exe.~\Documents\Projects\003 Data Projects\jw-parsers\.venv\Scripts\python.exe.-m#ipykernel_launcher
    > Interpreter Id = ~\Documents\Projects\003 Data Projects\jw-parsers\.venv\Scripts\python.exe
    > at new n (~\.vscode\extensions\ms-toolsai.jupyter-2025.9.0-win32-x64\dist\extension.node.js:62:51941)
    > originalException = Error: spawn "c:/<username>s/<username>/Documents/Projects/003 Data Projects/jw-parsers/.venv/Scripts/python.exe" ENOENT
    > stdErr = 
14:07:59.942 [error] Error in execution (get message for cell) Error: The kernel died. Error: ... View Jupyter [log](command:jupyter.viewOutput) for further details.
    > Kernel Id = .jvsc74a57bd0afc3510e580656b4ec2b0df362b50f8521590f26e05bf80bb6ecadd8772d063d.~\Documents\Projects\003 Data Projects\jw-parsers\.venv\Scripts\python.exe.~\Documents\Projects\003 Data Projects\jw-parsers\.venv\Scripts\python.exe.-m#ipykernel_launcher
    > Interpreter Id = ~\Documents\Projects\003 Data Projects\jw-parsers\.venv\Scripts\python.exe
    > at new n (~\.vscode\extensions\ms-toolsai.jupyter-2025.9.0-win32-x64\dist\extension.node.js:62:51941)
    > originalException = Error: spawn "c:/<username>s/<username>/Documents/Projects/003 Data Projects/jw-parsers/.venv/Scripts/python.exe" ENOENT
    > stdErr = 
14:07:59.944 [info] Process Execution: ~\Documents\Projects\003 Data Projects\jw-parsers\.venv\Scripts\python.exe -c "import ipykernel;print('6af208d0-cb9c-427f-b937-ff563e17efdf')"
14:07:59.944 [warn] Module ipykernel not installed in environment ~\Documents\Projects\003 Data Projects\jw-parsers\.venv\Scripts\python.exe Error: spawn "c:/<username>s/<username>/Documents/Projects/003 Data Projects/jw-parsers/.venv/Scripts/python.exe" ENOENT
    at Process.ChildProcess._handle.onexit (node:internal/child_process:285:19)
    at onErrorNT (node:internal/child_process:483:16)
    at processTicksAndRejections (node:internal/process/task_queues:90:21) {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'spawn "c:/<username>s/<username>/Documents/Projects/003 Data Projects/jw-parsers/.venv/Scripts/python.exe"',
  path: '"c:/<username>s/<username>/Documents/Projects/003 Data Projects/jw-parsers/.venv/Scripts/python.exe"',
  spawnargs: [
    '-c',
    "import ipykernel;print('6af208d0-cb9c-427f-b937-ff563e17efdf')"
  ]
}

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bugcandidateIssue identified as probable candidate for fixing in the next releaseverifiedVerification succeeded

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions