Wrong interpreter is chosen when running Format Cell in Jupyter Notebook in a mulltiroot workspace #18499
Labels
area-environments
Features relating to handling interpreter environments
bug
Issue identified by VS Code Team member as probable bug
info-needed
Issue requires more information from poster
investigating
We are looking into the cause of the issue
Issue Type: Bug
Behaviour
Expected vs. Actual
This is likely related to #18482, but not an exact duplicate.
Expected
When in a Jupyter Notebook, selecting Format Cell (either in context menu or via keyboard shortcut) the selected formatter (black in my case) runs from the Python interpreter path I selected for the kernel (which is the same in my case as the Python interpreter selected for the workspace folder).
Actual:
Even though the Python code in the notebook uses the kernel correctly, the formatter tries to run with the interpreter from another workspace folder (probably selected in alphabetical order from the workspace folders).
Steps to reproduce:
env1
andenv2
are "pristine" envs created byvirtualenv
workspace.code-workspace:
env2
:source folder2/env2/bin/activate
andpip install black
folder2/test.ipynb
and selectfolder2/env/bin/python
as kernel (will install ipykernel and other stuff)Notice that black was run as
code_bug/folder1/env1/bin/python -c "import black"
.I'd expect it to run from
folder2/env2/bin/python
as that's the kernel and the workspace folder interpreter too (I'm not sure which one should be the relevant here...)Diagnostic data
python.languageServer
setting: PylanceUser Settings
Extension version: 2022.0.1814523869
VS Code version: Code 1.64.1 (d6ee99e4c045a6716e5c653d7da8e9ae6f5a8b03, 2022-02-07T17:26:08.977Z)
OS version: Darwin x64 18.7.0
Restricted Mode: No
System Info
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
webgl: enabled
webgl2: enabled
A/B Experiments
The text was updated successfully, but these errors were encountered: