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

Not respecting the selected virtualenv kernel #13055

Closed
1 of 2 tasks
zakandrewking opened this issue Mar 10, 2023 · 2 comments
Closed
1 of 2 tasks

Not respecting the selected virtualenv kernel #13055

zakandrewking opened this issue Mar 10, 2023 · 2 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug notebook-execution Kernels issues (start/restart/switch/execution, install ipykernel)

Comments

@zakandrewking
Copy link

zakandrewking commented Mar 10, 2023

Applies To

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

What happened?

If I select try to run a kernel from a virtualenv, VSCode instead falls back to the global installation (where jupyter-notebook is not installed).

I can recreate this from scratch using a new virtualenv with just pip install jupyter notebook.

In the virtualenv, I can run jupyter-notebook, and VSCode will happily connect to the kernel if I choose "Select another Kernel > Existing Jupyter Server".

VS Code Version

Version: 1.76.1 Commit: 5e805b79fcb6ba4c2d23712967df89a089da575b Date: 2023-03-08T16:48:08.231Z (2 days ago) Electron: 19.1.11 Chromium: 102.0.5005.196 Node.js: 16.14.2 V8: 10.2.154.26-electron.0 OS: Darwin arm64 22.3.0 Sandboxed: Yes

Jupyter Extension Version

v2023.2.1200692131

Jupyter logs

https://gist.github.com/zakandrewking/9257c732336c48781745ba0078e683aa

Coding Language and Runtime Version

Python 3.11.2

Language Extension Version (if applicable)

No response

Anaconda Version (if applicable)

No response

Running Jupyter locally or remotely?

Local

@zakandrewking zakandrewking added the bug Issue identified by VS Code Team member as probable bug label Mar 10, 2023
@amunger
Copy link
Contributor

amunger commented Mar 10, 2023

You may need to run the command Jupyter: Select Interpreter to start Jupyter Server if I understand the issue correctly, although I'm surprised that we don't use the selected kernel if jupyter server is available there.

The interpreter we use for starting jupyter server isn't necessarily the same as the interpreter used to run the kernel.

@amunger amunger assigned DonJayamanne and unassigned amunger Mar 10, 2023
@amunger amunger added the notebook-execution Kernels issues (start/restart/switch/execution, install ipykernel) label Mar 10, 2023
@zakandrewking
Copy link
Author

That worked! thank you (might be nice to have this in the docs, if other people get the same behavior)

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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

3 participants