Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python kernel installation should report error through its notification #15740

Closed
1 of 2 tasks
ulugbekna opened this issue Jun 4, 2024 · 1 comment
Closed
1 of 2 tasks
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug notebook-execution Kernels issues (start/restart/switch/execution, install ipykernel)

Comments

@ulugbekna
Copy link

Applies To

  • Notebooks (.ipynb files)
  • Interactive Window and/or Cell Scripts (.py files with #%% markers)

What happened?

Repro:

  1. Change the kernel to a python version that doesn't have kernel package installation
  2. Click on "install" when you get a dialog prompt to install kernel
  3. Installation shows progress notification but swiftly disappears without letting user know about the problem; the cell output also prints the problem that should've been solved by the installation instead of telling that installation failed.
Screen.Recording.2024-06-04.at.11.32.59.mov

VS Code Version

Version: 1.90.0-insider Commit: 89de5a8d4d6205e5b11647eb6a74844ca23d2573 Date: 2024-06-04T01:35:33.174Z Electron: 29.4.0 ElectronBuildId: 9593362 Chromium: 122.0.6261.156 Node.js: 20.9.0 V8: 12.2.281.27-electron.0 OS: Darwin arm64 23.5.0

Jupyter Extension Version

v2024.5.2024052901 (pre-release)

Jupyter logs

11:34:11.622 [info] Process Execution: /opt/homebrew/bin/python3 -c "import pip;print('6af208d0-cb9c-427f-b937-ff563e17efdf')"
11:34:15.721 [info] Process Execution: /opt/homebrew/bin/python3 -c "import pip;print('6af208d0-cb9c-427f-b937-ff563e17efdf')"
11:34:15.750 [info] Process Execution: /opt/homebrew/bin/python3 -m pip install -U --user ipykernel
11:34:16.245 [error] Failed to install ipykernel error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try brew install
xyz, where xyz is the package you are trying to
install.

If you wish to install a non-brew-packaged Python package,
create a virtual environment using python3 -m venv path/to/venv.
Then use path/to/venv/bin/python and path/to/venv/bin/pip.

If you wish to install a non-brew packaged Python application,
it may be easiest to use pipx install xyz, which will manage a
virtual environment for you. Make sure you have pipx installed.

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.

11:34:16.246 [info] Dispose Kernel '/code/intent-detection/logsprobs.ipynb' associated with '/code/intent-detection/logsprobs.ipynb'
11:34:16.247 [error] Error in execution Error: The kernel died. Error: /opt/homebrew/opt/[email protected]/bin/python3.12: No module named ipykernel_launcher... View Jupyter log for further details.
> Kernel Id = .jvsc74a57bd0b0fa6594d8f4cbf19f97940f81e996739fb7646882a419484c72d19e05852a7e./opt/homebrew/bin/python3./opt/homebrew/bin/python3.-m#ipykernel_launcher
> Interpreter Id = /opt/homebrew/bin/python3
> at DT. (/Users//.vscode-insiders/extensions/ms-toolsai.jupyter-2024.5.2024052901-darwin-arm64/dist/extension.node.js:314:11641)
> stdErr = /opt/homebrew/opt/[email protected]/bin/python3.12: No module named ipykernel_launcher
> vslsStack = DT. (/Users/
/.vscode-insiders/extensions/ms-toolsai.jupyter-2024.5.2024052901-darwin-arm64/dist/extension.node.js:314:11641),l.y (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:82:664),l.z (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:82:734),l.fire (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:82:950),ChildProcess. (/Users//.vscode-insiders/extensions/ms-toolsai.jupyter-2024.5.2024052901-darwin-arm64/dist/extension.node.js:309:44184),ChildProcess.emit (node:events:526:35),ChildProcess._handle.onexit (node:internal/child_process:294:12)
11:34:16.247 [error] Error in execution (get message for cell) Error: The kernel died. Error: /opt/homebrew/opt/[email protected]/bin/python3.12: No module named ipykernel_launcher... View Jupyter log for further details.
> Kernel Id = .jvsc74a57bd0b0fa6594d8f4cbf19f97940f81e996739fb7646882a419484c72d19e05852a7e./opt/homebrew/bin/python3./opt/homebrew/bin/python3.-m#ipykernel_launcher
> Interpreter Id = /opt/homebrew/bin/python3
> at DT. (/Users/
/.vscode-insiders/extensions/ms-toolsai.jupyter-2024.5.2024052901-darwin-arm64/dist/extension.node.js:314:11641)
> stdErr = /opt/homebrew/opt/[email protected]/bin/python3.12: No module named ipykernel_launcher
> vslsStack = DT. (/Users//.vscode-insiders/extensions/ms-toolsai.jupyter-2024.5.2024052901-darwin-arm64/dist/extension.node.js:314:11641),l.y (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:82:664),l.z (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:82:734),l.fire (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:82:950),ChildProcess. (/Users//.vscode-insiders/extensions/ms-toolsai.jupyter-2024.5.2024052901-darwin-arm64/dist/extension.node.js:309:44184),ChildProcess.emit (node:events:526:35),ChildProcess._handle.onexit (node:internal/child_process:294:12)
11:34:16.248 [info] Process Execution: /opt/homebrew/bin/python3 -c "import ipykernel;print('6af208d0-cb9c-427f-b937-ff563e17efdf')"

Coding Language and Runtime Version

python 3.12.2 (installed with brew at /opt/homebrew/bin/python3)

Language Extension Version (if applicable)

v2024.7.11511013 (pre-release)

Anaconda Version (if applicable)

No response

Running Jupyter locally or remotely?

Local

@ulugbekna ulugbekna added the bug Issue identified by VS Code Team member as probable bug label Jun 4, 2024
@DonJayamanne DonJayamanne added the notebook-execution Kernels issues (start/restart/switch/execution, install ipykernel) label Dec 10, 2024
@DonJayamanne
Copy link
Contributor

Duplicate of #16294

@DonJayamanne DonJayamanne marked this as a duplicate of #16294 Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug notebook-execution Kernels issues (start/restart/switch/execution, install ipykernel)
Projects
None yet
Development

No branches or pull requests

2 participants