Skip to content

Jupyter notebook kernel changes not detected to Pylance #6333

@aroxred

Description

@aroxred

Environment data

  • VS Code version: 1.57.1
  • Jupyter Extension version (available under the Extensions sidebar): v2021.6.999406279
  • Python Extension version (available under the Extensions sidebar): v2021.6.944021595
  • OS (Windows | Mac | Linux distro) and version: Windows 19043
  • Python and/or Anaconda version: 3.8.5
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): venv
  • Jupyter server running: Local

Expected behaviour

Upon changing the kernel in the top right Pylance should detect module changes and resolve imports

Code_AIlNLawSya

Actual behaviour

Pylance will only detect kernel changes if you change the interpreter via the command palette

Before changing via command palette
Code_5gyZtvgN7r

After changing
Code_A4F75UVgZw

Imports resolve

Steps to reproduce:

  1. Create a venv and install any pip module foo
  2. Create a notebook and import foo
  3. The pylance import detection will not update via changing kernel
  4. Changing via Python: Select Interpreter in the command palette will update Pylance

Note: code execution will work as if the venv is selected, but highlighting doesn't.
Another note: I'm sure a lot of my lingo I'm using is incorrect, I'm just starting out :)

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bugnotebook-intellisenseIntellisense & other language features in notebook cells for any languageverifiedVerification succeeded

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions