Skip to content

Preferred Python Notebook Kernel #9615

Closed

Description

This issue focuses on suggestions/ideas that can help improve the preferred/suggested kernel for Python Notebooks & Interactive Window.

Problems faced by users with regards to kernel selection?

  • Active Python interpreter (default kernel in Notebook/IW) does not have ipykernel dependencies installed.
  • User selects a Python kernel which does not have ipykernel dependencies installed.
    • Work arounds:
      • Keep trying until something works. However if one doesn't keep track of the kernel, they end up in the same situation again when opening a new notebook.
      • If they are an existing Jupyter user, then look for that same environment in the list (I would assume more advanced user would try this).
  • User ends up selecting a Python kernel which does not the user dependencies (tensorflow, pandas, etc) installed.
    • I.e. the user tries something out in Jupyter or the terminal. And then hear about VS Code and attempt to try something in VS Code, but things wont work here as the Python environment used is not the same.
  • User knows that a specific kernel works, and need to search for this kernel again & again when creating new notebooks
    • Basically when you open a notebook and hit Run, you have to go through the kernel list to pick the right item, & it could be 1/2 way down the list.

Summary of the problems:

  • Takes longer to get started,
  • End user confusion (why are they getting prompts, what is ipykernel, what is a kernel, why do i need to install, things work in terminal, etc)
  • The likely-hood of things not working in Jupyter extension increases with the number of Python environments.
  • Starting with new notebooks always takes time, as one needs to search for the right kernel everytime

Suggestions

  • Add hints to kernel picker to indicate which Python environments have IPyKernel (user request)
  • For new Notebooks recommend the kernel that was last selected in a new notebook (user request)
  • If conda has been activated in a terminal and VS Code launched from a terminal use that conda env
  • Auto select the base environment from Conda as the preferred kernel
    • Why?: Assumption is that if a user has conda installed, then they use conda most of the time & expect the same env to be used elsewhere (i.e. when the launch the terminal, they always use the same base conda env). Note: the default base can be configured in conda.
    • Default and/or suggest environment for new notebooks #9115
  • The default Python environment that's available in the terminal (current PATH variable) is not the same as the default in VS Code.
    • Why? User runs code in the terminal and things work, Now they go into VS Code and the active interpreter is not the same as the default, hence things won't necessarily work as expected. Now the user needs to learn to pick the right kernel.
    • Jupyter notebooks not using Python in current path #5998
  • Allow users to select an item from the kernel list as the default (preferred) for notebooks
    • How will this work if Jupyter extension nominates a kernel as the preferred? Which takes precedence?
    • How can a user manage this? If they select something as a default, how do they re-set this? Do they need to?
  • Create a blessed Python environment with everything in it
    • Create a Python environment that has all of the dependencies and promote this as the preferred kernel.
  • There are too many kernels, hence we need to allow users to filter/exclude items from the list
    • We ended up adding the ability to filter/exclude kernels from the dropdown list.
  • If the preferred kernel doesn't work, then don't mark that kernel as the preferred kernel until and unless we know it works (next time)

Legend:

IW Python Interactive Window
Notebook Python Jupyter Notebook
IPyKernel Python package required by Jupyter to start a Jupyter kernel inside a specific Python environment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bugnotebook-getting-startednotebook-kernelKernels issues (start/restart/switch/execution, install ipykernel)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions