text:
Duplicate app settings context menu items

We should add new option to the AppSettingsTreeItem constructor so we can customize the context value and then scope down the commands in the package.json to only apply to each extensions app settings tree items.

Fixed by #3125

repo: microsoft/vscode-azurefunctions


text:
Extension causes high cpu load

Issue Type: Performance
Extension Name: vscode-logicapps
Extension Version: 1.0.9
OS Version: Windows_NT x64 10.0.17763
VS Code version: 1.55.2

:warning: Make sure to attach this file from your home-directory:
:warning:c:\Users\engstroj\AppData\Local\Temp\ms-azuretools.vscode-logicapps-unresponsive.cpuprofile.txt
Find more details here: https://github.com/microsoft/vscode/wiki/Explain-extension-causes-high-cpu-load

Duplicate of #149.

source: gharchive/issue

authors: joechung-msft jordanengstrom

repo: microsoft/vscode-azurelogicapps

license: MIT

license_type: permissive

license_source: github-api


text:
When vscode is turned on for the first time, copilot will not perform auto-complete and will have to wait a long time

When vscode is turned on for the first time, copilot will not perform auto-complete and will have to wait a long time
https://github.com/microsoft/vscode-copilot-release/assets/122137647/04bc3726-ce2e-489c-b21a-3cbd7fd70f6d

This is actually related to the GitHub Copilot extension, not the GitHub Copilot Chat extension. Please report this at https://github.com/community/community/discussions/categories/copilot

authors: Tyriar laterdayi

repo: microsoft/vscode-copilot-release


text:
Newline chars not displayed consistently when in message textbox and when the message is sent and displayed back

Copilot Chat Extension Version: v0.18.2

Version: 1.92.2 (user setup)
Commit: fee1edb8d6d72a0ddff41e5f71a671c23ed924b9
Date: 2024-08-14T17:29:30.058Z
Electron: 30.1.2
ElectronBuildId: 9870757
Chromium: 124.0.6367.243
Node.js: 20.14.0
V8: 12.4.254.20-electron.0
OS: Windows_NT x64 10.0.22631
Steps to Reproduce:

Text with rows closed by a newline char only (no carriage return char)
Copy text in message textbox in copilot chat within VS Code - each row is displayed correctly honoring newlines
Send message and message is echoed back on screen with all rows appended one after the other (with no newlines in place) making the overall thing unreadable

The request is rendered as markdown, which typically has this behavior. You can start a new paragraph with new newlines. Or maybe you want a list or a codeblock

authors: roblourens smapelli


text:
Copilot outdated, doesn't know about yolov8

It perfectly assisted me with install/issues on yolov5, but on yolov8 it couldn't help:

I apologize for any confusion, but as of my last training data, YOLOv8 does not exist. My training data includes information up to YOLOv5. If Ultralytics has indeed released YOLOv8, my current knowledge does not include information about this version.

As an AI, my knowledge is based on the training data I was last provided. I don't have the ability to access or retrieve real-time information from the internet or external databases. Therefore, I recommend referring to the official documentation or trusted sources for the most accurate and up-to-date information about YOLOv8.

Same for Flutter, I am getting answers from 2021 and 2022 :(

Same for node and typescript

Yup, as of right now, Flutter version is 3.19.5, and the chat confidently responded "It seems there's a misunderstanding. Flutter's latest stable version at the time of writing is 2.8.1. If you're referring to Dart SDK version as 3.19.5, that's also not correct as Dart's latest stable version is 2.15.1."
When are we going to feed it new data? For frontend technologies, outdated info is totally useless.

Dear team, kindly update the flutter and dart knowledge so we can benefit.
Stop posting new stuff in blogs instead try to update with these fixes
On Fri, May 24, 2024, 7:47 PM zivshek @.***> wrote:

Yup, as of right now, Flutter version is 3.19.5, and the chat confidently
responded "It seems there's a misunderstanding. Flutter's latest stable
version at the time of writing is 2.8.1. If you're referring to Dart SDK
version as 3.19.5, that's also not correct as Dart's latest stable version
is 2.15.1."
When are we going to feed it new data? For frontend technologies, outdated
info is totally useless.
—
Reply to this email directly, view it on GitHub
https://github.com/microsoft/vscode-copilot-release/issues/910#issuecomment-2129720656,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AIRXJSFNHTKFDROJOQEGMDDZD5HJVAVCNFSM6AAAAABDNPVRMCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMRZG4ZDANRVGY
.
You are receiving this because you commented.Message ID:
@.***>

authors: LizardWizard777 deathvulture fisforfaheem zivshek


text:
NVS fails to install in codespaces-linux image

CI failed when trying to install "nvs" in the codespaces-linux image for some reason.
See https://github.com/microsoft/vscode-dev-containers/runs/5999818611?check_suite_focus=true
I backed the version number down to what is already released (1.7.5) for v0.231.6.  (https://github.com/microsoft/vscode-dev-containers/commit/6a723ddef0f80dfcffdddff79efd05b657207485)
Bump back up to 1.7.6 when it's ready to go.

This is due to the new changes in git.  Should be fixed!

authors: Chuxel joshspicer

repo: microsoft/vscode-dev-containers


text:
javascript-node-mongo devcontainer rebuild fails

VSCode Version: 1.55.0
Local OS Version: Windows 10 2004
WSL Ubuntu 20.04
Docker v20.10.5
Name of Dev Container Definition with Issue: javascript-node-mongo

Steps to Reproduce:

Remote-Containers: Rebuild an Reopen in Container

Error Log:
[2021-04-01T08:07:54.129Z] [PID 12348]
[+] Building 4.6s (5/6)
 => [internal] load build definition from Dockerfile                       0.0s
 => => transferring dockerfile: 38B                                        0.0s
 => [internal] load .dockerignore                                          0.1s
 => => transferring context: 2B                                            0.0s
 => [internal] load metadata for mcr.microsoft.com/vscode/devcontainers/j  0.0s
 => CACHED [1/3] FROM mcr.microsoft.com/vscode/devcontainers/javascript-n  0.0s
 => ERROR [2/3] RUN curl -sSL "https://www.mongodb.org/static/pgp/server-  4.4s
------
 > [2/3] RUN curl -sSL "https://www.mongodb.org/static/pgp/server-4.2.asc" | (OU
T=$(apt-key add - 2>&1) || echo $OUT)     && echo "deb http://repo.mongodb.org/a
pt/debian $(lsb_release -cs)/mongodb-org/4.2 main" | tee /etc/apt/sources.list.d
/mongodb-org-4.2.list     && apt-get update && export DEBIAN_FRONTEND=noninterac
tive     && apt-get install -y mongodb-org-tools mongodb-org-shell     && apt-ge
t clean -y && rm -rf /var/lib/apt/lists/*:
#4 1.383 deb http://repo.mongodb.org/apt/debian buster/mongodb-org/4.2 main
#4 1.566 Get:1 http://deb.debian.org/debian buster InRelease [121 kB]
#4 1.568 Get:2 http://security.debian.org/debian-security buster/updates InRelea
se [65.4 kB]
#4 1.573 Get:3 https://dl.yarnpkg.com/debian stable InRelease [17.1 kB]
#4 1.669 Get:4 http://deb.debian.org/debian buster-updates InRelease [51.9 kB]
#4 1.706 Err:3 https://dl.yarnpkg.com/debian stable InRelease
#4 1.706   The following signatures were invalid: EXPKEYSIG 23E7166788B63E1E Yar
n Packaging <yarn@dan.cx>
#4 1.766 Ign:5 http://repo.mongodb.org/apt/debian buster/mongodb-org/4.2 InRelea
se
#4 1.793 Get:6 http://repo.mongodb.org/apt/debian buster/mongodb-org/4.2 Release
 [1488 B]
#4 1.852 Get:7 http://security.debian.org/debian-security buster/updates/main am
d64 Packages [269 kB]
#4 1.931 Get:8 http://repo.mongodb.org/apt/debian buster/mongodb-org/4.2 Release
.gpg [801 B]
#4 2.003 Get:9 http://deb.debian.org/debian buster/main amd64 Packages [7907 kB]
#4 2.513 Get:10 http://repo.mongodb.org/apt/debian buster/mongodb-org/4.2/main a
md64 Packages [10.9 kB]
#4 2.728 Get:11 http://deb.debian.org/debian buster-updates/main amd64 Packages
[9504 B]
#4 3.731 Reading package lists...
#4 4.308 W: GPG error: https://dl.yarnpkg.com/debian stable InRelease: The follo
wing signatures were invalid: EXPKEYSIG 23E7166788B63E1E Yarn Packaging <yarn@da
n.cx>
#4 4.308 E: The repository 'https://dl.yarnpkg.com/debian stable InRelease' is n
ot signed.
------
executor failed running [/bin/sh -c curl -sSL "https://www.mongodb.org/static/pg
p/server-${MONGO_TOOLS_VERSION}.asc" | (OUT=$(apt-key add - 2>&1) || echo $OUT)
    && echo "deb http://repo.mongodb.org/apt/debian $(lsb_release -cs)/mongodb-o
rg/${MONGO_TOOLS_VERSION} main" | tee /etc/apt/sources.list.d/mongodb-org-${MONG
O_TOOLS_VERSION}.list     && apt-get update && export DEBIAN_FRONTEND=noninterac
tive     && apt-get install -y mongodb-org-tools mongodb-org-shell     && apt-ge
t clean -y && rm -rf /var/lib/apt/lists/*]: exit code: 100
ERROR: Service 'app' failed to build

docker-compose.yml
version: "3"

services:
  app:
    build:
      context: .
      dockerfile: Dockerfile
      args:
        # [Choice] Node.js version: 14, 12, 10
        VARIANT: 14
        # On Linux, you may need to update USER_UID and USER_GID below if not your local UID is not 1000.
        USER_UID: 1000
        USER_GID: 1000

    volumes:
      - ..:/workspace:cached

    # Overrides default command so things don't shut down after the process ends.
    command: sleep infinity

    # Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function.
    network_mode: service:mongo

    # Uncomment the next line to use a non-root user for all processes.
    # user: node

    # Use "forwardPorts" in **devcontainer.json** to forward an app port locally.
    # (Adding the "ports" property to this file will not forward from a Codespace.)

  mongo:
    image: mongo:latest
    restart: unless-stopped
    volumes:
      - mongodb-data:/data/db

    # Uncomment to change startup options
    environment:
      MONGO_INITDB_ROOT_USERNAME: sevi
      MONGO_INITDB_ROOT_PASSWORD: mongobili
    #   MONGO_INITDB_DATABASE: my-api/

    # Add "forwardPorts": ["27017"] to **devcontainer.json** to forward MongoDB locally.
    # (Adding the "ports" property to this file will not forward from a Codespace.)

volumes:
  mongodb-data:

devcontainer.json
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.154.0/containers/javascript-node-mongo
// Update the VARIANT arg in docker-compose.yml to pick a Node.js version: 10, 12, 14
{
  "name": "Node.js & Mongo DB Rest Api",
  "dockerComposeFile": "docker-compose.yml",
  "service": "app",
  "workspaceFolder": "/workspace",

  // Set *default* container specific settings.json values on container create.
  "settings": {
    "terminal.integrated.shell.linux": "/bin/bash"
  },

  // Add the IDs of extensions you want installed when the container is created.
  "extensions": [
    "dbaeumer.vscode-eslint",
    "mongodb.mongodb-vscode",
    "visualstudioexptteam.vscodeintellicode",
    "tabnine.tabnine-vscode",
    "esbenp.prettier-vscode"
  ],

  // Use 'forwardPorts' to make a list of ports inside the container available locally.
  "forwardPorts": [8080, 5555, 5556],

  // Use 'postCreateCommand' to run commands after the container is created.
  // "postCreateCommand": "yarn install",

  // Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
  "remoteUser": "node"
}

@sevspo You likely have an out of date version of the javascript-node image cached. Yarn's GPG key expired, but has since been updated.  Run docker pull mcr.microsoft.com/vscode/devcontainers/javascript-node:14 and retry.

I faced a similar issue.
Problem 1
The problem is with line 7 of https://github.com/microsoft/vscode-dev-containers/blob/master/containers/javascript-node-mongo/.devcontainer/Dockerfile.
This is the exact error that points out the bug.
E: Failed to fetch http://repo.mongodb.org/apt/debian/dists//mongodb-org/4.4/main/binary-amd64/Packages  404  Not Found [IP: 13.33.144.66 80]

It tries to run curl on a non-existent URL. (Notice a double forward slash after dists).
Problem 2
I tried hardcoding the URL to the existing URL to check if that was solved. It did solve the previous error. This is the new one.
E: Malformed entry 1 in list file /etc/apt/sources.list.d/mongodb-org-4.2.list (Suite)
E: The list of sources could not be read.

I tried fixing the error and making a pull request. But I got stuck in the second error for so long.
Do try out docker-compose up in the /containers/javascript-node-mongo/.devcontainer/ directory to view that error.

@sevspo You likely have an out of date version of the javascript-node image cached. Yarn's GPG key expired, but has since been updated. Run docker pull mcr.microsoft.com/vscode/devcontainers/javascript-node:14 and retry. Does that resolve it?

@Chuxel Yes, that indeed did solve the problem. But only after waiting for another week until the new keys were valid. Thank you very much for the help. 😁

authors: AbhayVAshokan Chuxel sevspo


text:
Preview doesn't indent code in lists properly

When a list contains code block, the code is not shown correctly indented in the preview window.
For example, consider the following markdown:
1. Some text.

    ```c#
    class C
    {
        void M();
    }
    ```

Here, void M(); should show indented, but it doesn't:

Hi @svick , it looks like this issue has been fixed.  I just tried to repro in docs-preview version 0.3.36 and it worked as expected.  Please let us know if you run into any more issues.  Thanks

authors: jamarw svick

repo: microsoft/vscode-docs-authoring


text:
[Draft] Upgrade to emmet@2

An update: https://github.com/microsoft/vscode-emmet-helper/pull/32#issuecomment-586694063
Hi @octref, this PR upgrages emmet to v2 and gets rid of the old expand-full.js and @emmetio/* packages as we discussed here.
So basically what I have done is kept the public api of this package same and mapped the helper's expand, extract and parse functions to emmet@2's expand, extract and parse via emmetCompat.ts
I thought this would be the best way because people shouldn't be made to change their vscode setting for this upgrade and there are not many breaking changes.
I've added quite some types because without them I couldn't understand what's going on. Few are still missing and I've added TODO comments there. So I'm 95% sure this should work.
There are few changes in the test I would be making them clear in the github code comments.
Pending things:

Look if any cases are missing from current tests. (Update: Realized this doesn't take care of syntax profiles and also variables and it's not in the tests so missed out on that)
The newer emmet has a lot more capabilities so update the configuration's json schema and (probably?) write test for them.
The older emmet had addons, options (preferences), format etc seperate the newer has only options which has all these three. So currently what this helper is doing is VscodeConf -> OldEmmentConf -> NewEmmetConf but VscodeConf and NewEmmetConf are quite similar so VscodeConf should be made same as NewEmmetConf keeping it backward compatible.
Probably this module isn't doing much so it should be actually taken downstream and included in the vscode/extensions/emmet module. And once the vscode's conf is good it can be directly passed to the newer emmet's expand.

Closes #63703
Closes #80923
Closes #59951
Closes #71002
Closes #45724 (via this)
Closes #52345 (via this)
Closes #59172 (via this)
Closes #67971
Closes probably many more issues and hopefully doesn't open issues xD

Closing might reopen if I get back

source: gharchive/pull-request

repo: microsoft/vscode-emmet-helper

license: mit

license_source: bigquery


text:
Can't auto refresh when delete package from Java Project Explorer.

Environment:
OS: Win
Vscode: 1.53.0
Vscode java project manager: 0.18.0
Actual Behaviour:
Can't auto refresh when delete package from Java Project Explorer.

Currently we are only watching files under src/

authors: chenyuanmac jdneo

repo: microsoft/vscode-java-dependency


text:
Subprocess keeps running after cell interruption (subshell)

Environment data

VS Code version: Version: 1.85.1
Jupyter Extension version (available under the Extensions sidebar): v2023.11.1003402403
Python Extension version (available under the Extensions sidebar): v2023.22.1
OS (Windows | Mac | Linux distro) and version: Local: MacOS Ventura 13.4.1, Remote: Ubuntu 22.04.3 LTS
Python and/or Anaconda version: Python 3.11.7, miniconda3-3.11-23.11.0-2
Type of virtual environment used (N/A | venv | virtualenv | conda | ...): pyenv, miniconda
Jupyter server running: Reproduces when local and remote, but a bit differently

Expected behaviour
When cell is interrupted, any running subprocesses started in this cell are terminated
Actual behaviour
https://github.com/microsoft/vscode-jupyter/assets/4602302/699b9a25-94b1-4e29-aca7-82e1ce92dbb6
Before interruption:

After interruption:

You can see that shell child process is terminated but python loop remains dangling.
Steps to reproduce:
There are a few ways to reproduce it, but the key point is to run subprocess in subshell. I was able to reproduce it when jupyter server is running locally and remotely, though when connecting to remote server it reproduces more often.
loop.py:
import time
for i in range(100000):
    print('loop.py:', i, flush=True)
    time.sleep(0.5)

# if you run this cell and interrupt it, subprocess will keep running. This is reproduced both on local and remote kernels
%%sh
python loop.py

###

# same issue, though I was able to reproduce it only on remote server. Maybe there is difference between MacOS/Linux?
subprocess.run('python loop.py', shell=True)

###

# though if subprocess is started without subshell, it terminates correctly
!python loop.py

###

# this also terminates on interruption
subprocess.run(['python', 'loop.py'], shell=False)

###

I checked the same steps with Jupyter lab and plain ipython, and there were no such issues, i.e. when I interrupted execution subprocess were terminated correctly.
https://github.com/microsoft/vscode-jupyter/assets/4602302/2f884cf5-8192-4c1d-bafd-583e4194a7d0
Logs

Output for Jupyter in the Output panel (View→Output, change the drop-down the upper-right of the Output panel to Jupyter)

17:27:14.239 [info] Handle Execution of Cells 3 for ~/lichess/test_interrupt.ipynb
17:27:14.246 [debug] Cell Index:3 sent to kernel
17:27:14.254 [debug] Start cell 3 execution @ 1703957234254 (clear output)
17:27:14.255 [info] Kernel acknowledged execution of cell 3 @ 1703957234254
17:27:17.526 [debug] VS Code interrupted kernel for ~/lichess/test_interrupt.ipynb
17:27:17.527 [debug] Command interrupted kernel for ~/lichess/test_interrupt.ipynb
17:27:17.527 [debug] interrupt the kernel, options.disableUI=false for ~/lichess/test_interrupt.ipynb
17:27:17.527 [info] Interrupt kernel execution
17:27:17.527 [debug] Cancel pending cells
17:27:17.528 [info] Interrupt requested ~/lichess/test_interrupt.ipynb
17:27:17.528 [info] Interrupt kernel execution
17:27:17.528 [info] Interrupting kernel: pythonjvsc74a57bd049169f8013b1c4a348b385264fb83aa338acd62288944654d64458e1964c50ae
17:27:17.528 [info] Interrupting kernel via SIGINT
17:27:17.635 [info] End cell 3 execution after 3.381s, completed @ 1703957237635, started @ 1703957234254
17:27:17.636 [debug] Cell 3 executed with state Success
17:27:17.637 [info] Interrupt requested & sent for ~/lichess/test_interrupt.ipynb in notebookEditor.
17:27:17.781 [debug] Start cell 3 execution @ undefined
17:27:17.781 [info] End cell 3 execution after 1703957237.635s, completed @ 1703957237635, started @ undefined
17:27:18.281 [debug] Start cell 3 execution @ undefined
17:27:18.281 [info] End cell 3 execution after 0s, completed @ undefined, started @ undefined
17:27:18.782 [debug] Start cell 3 execution @ undefined
17:27:18.782 [info] End cell 3 execution after 0s, completed @ undefined, started @ undefined
17:27:19.282 [debug] Start cell 3 execution @ undefined
17:27:19.282 [info] End cell 3 execution after 0s, completed @ undefined, started @ undefined
17:27:19.781 [debug] Start cell 3 execution @ undefined
17:27:19.782 [info] End cell 3 execution after 0s, completed @ undefined, started @ undefined
17:27:20.282 [debug] Start cell 3 execution @ undefined
17:27:20.282 [info] End cell 3 execution after 0s, completed @ undefined, started @ undefined
17:27:20.782 [debug] Start cell 3 execution @ undefined
17:27:20.783 [info] End cell 3 execution after 0s, completed @ undefined, started @ undefined
17:27:21.283 [debug] Start cell 3 execution @ undefined
17:27:21.283 [info] End cell 3 execution after 0s, completed @ undefined, started @ undefined
17:27:21.783 [debug] Start cell 3 execution @ undefined
17:27:21.783 [info] End cell 3 execution after 0s, completed @ undefined, started @ undefined
17:27:22.283 [debug] Start cell 3 execution @ undefined
17:27:22.284 [info] End cell 3 execution after 0s, completed @ undefined, started @ undefined
17:27:22.783 [debug] Start cell 3 execution @ undefined
17:27:22.783 [info] End cell 3 execution after 0s, completed @ undefined, started @ undefined
17:27:23.283 [debug] Start cell 3 execution @ undefined
17:27:23.283 [info] End cell 3 execution after 0s, completed @ undefined, started @ undefined
17:27:23.784 [debug] Start cell 3 execution @ undefined

Thank you filing this issue and sorry you are running into this.
Please can you share the full logs when you run into this issue in Jupyter extension (I would need all of the logs, to see what kernel is staretd alogn with the pytholn environment information as well).
Also in Jupyter Lab, please can you run the following code and let me know what you get import sys;print(sys.executable)
thanks
Please could you enable logging as follows:

Open settings & go into Jupyter->Logging
Change the value to verbose
Reload VS Code,
Attempt to repro the issue & then copy the output from the Jupyter output panel.

Hi, @DonJayamanne, you can't to reproduce it? Do you think it could depend on specific python version? As you can see below, both VSCode and Jupyter lab use the same python executable.

Also in Jupyter Lab, please can you run the following code and let me know what you get import sys;print(sys.executable)

Jupyter lab:

VSCode:

I added more logs, hope, it will be enough, if you need  more information, let me know.

VSCode Jupyter logs
01:55:48.321 [debug] Initialize notebook communications for editor ~/lichess/test_interrupt.ipynb
01:55:48.321 [debug] Resolving notebook UI Comms (resolve) for ~/lichess/test_interrupt.ipynb
01:55:48.321 [debug] initialize CommonMessageCoordinator
01:55:48.321 [debug] IPyWidgetMessageDispatcher.initialize
01:55:48.321 [debug] Attempting to determine version of IPyWidgets
01:55:48.323 [debug] KernelProvider switched kernel to id = .jvsc74a57bd049169f8013b1c4a348b385264fb83aa338acd62288944654d64458e1964c50ae.~/.pyenv/versions/miniconda3-3.11-23.11.0-2/python.~/.pyenv/versions/miniconda3-3.11-23.11.0-2/python.-m#ipykernel_launcher
01:55:48.323 [debug] start the kernel, options.disableUI=true for ~/lichess/test_interrupt.ipynb
01:55:48.323 [debug] Preferred Remote kernel for ~/lichess/test_interrupt.ipynb is undefined
01:55:48.323 [debug] Waiting for IPyWidgets version
01:55:48.323 [debug] Waiting for IPyWidgets version promise
01:55:48.324 [debug] Initialize notebook communications for editor ~/lichess/test_interrupt.ipynb
01:55:48.324 [debug] Resolving notebook UI Comms (resolve) for ~/lichess/test_interrupt.ipynb
01:55:48.324 [debug] initialize CommonMessageCoordinator
01:55:48.325 [debug] Registering commtarget jupyter.widget
01:55:48.325 [debug] IPyWidgetMessageDispatcher.initialize
01:55:48.325 [debug] Attempting to determine version of IPyWidgets
01:55:48.325 [debug] Controller selection change completed
01:55:48.325 [debug] Waiting for IPyWidgets version
01:55:48.325 [debug] Waiting for IPyWidgets version promise
01:55:48.326 [info] Starting Kernel startUsingPythonInterpreter, .jvsc74a57bd049169f8013b1c4a348b385264fb83aa338acd62288944654d64458e1964c50ae.~/.pyenv/versions/miniconda3-3.11-23.11.0-2/python.~/.pyenv/versions/miniconda3-3.11-23.11.0-2/python.-m#ipykernel_launcher  (Python Path: ~/.pyenv/versions/miniconda3-3.11-23.11.0-2/bin/python, Conda, base, 3.11.7) for '~/lichess/test_interrupt.ipynb' (disableUI=true)
01:55:48.326 [debug] Creating raw notebook for resource '~/lichess/test_interrupt.ipynb'
01:55:48.333 [debug] Getting activated env variables, Class name = Ip (started execution), Arg 1: "~/lichess/test_interrupt.ipynb", Arg 2: "~/.pyenv/versions/miniconda3-3.11-23.11.0-2/bin/python", Arg 3: undefined
01:55:48.333 [debug] Get Custom Env Variables, Class name = _m (started execution), Arg 1: "~/lichess/test_interrupt.ipynb", Arg 2: "RunPythonCode"
01:55:48.333 [debug] Get Custom Env Variables, Class name = _m, completed in 0ms, has a truthy return value, Arg 1: "~/lichess/test_interrupt.ipynb", Arg 2: "RunPythonCode"
01:55:48.334 [debug] Got env vars with python ~/.pyenv/versions/miniconda3-3.11-23.11.0-2/bin/python, with env var count 50 in 1ms.
    PATH value is ~/.pyenv/versions/miniconda3-3.11-23.11.0-2/bin:~/.pyenv/versions/miniconda3-3.11-23.11.0-2/condabin:~/.pyenv/versions/miniconda3-3.11-23.11.0-2/bin:~/.pyenv/libexec:~/.pyenv/plugins/python-build/bin:~/.pyenv/plugins/pyenv-virtualenv/bin:~/.pyenv/plugins/pyenv-update/bin:~/.pyenv/plugins/pyenv-doctor/bin:~/.vscode-server/bin/0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2/bin/remote-cli:~/.pyenv/plugins/pyenv-virtualenv/shims:~/.pyenv/shims:~/.pyenv/bin:~/.pyenv/plugins/pyenv-virtualenv/shims:~/.pyenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin and
    Path value is undefined
01:55:48.334 [debug] Prepend PATH with python bin for ~/.pyenv/versions/miniconda3-3.11-23.11.0-2/bin/python
01:55:48.334 [debug] Activated Env Variables for ~/.pyenv/versions/miniconda3-3.11-23.11.0-2/bin/python,
    PATH value is ~/.pyenv/versions/miniconda3-3.11-23.11.0-2/bin:~/.pyenv/versions/miniconda3-3.11-23.11.0-2/condabin:~/.pyenv/versions/miniconda3-3.11-23.11.0-2/bin:~/.pyenv/libexec:~/.pyenv/plugins/python-build/bin:~/.pyenv/plugins/pyenv-virtualenv/bin:~/.pyenv/plugins/pyenv-update/bin:~/.pyenv/plugins/pyenv-doctor/bin:~/.vscode-server/bin/0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2/bin/remote-cli:~/.pyenv/plugins/pyenv-virtualenv/shims:~/.pyenv/shims:~/.pyenv/bin:~/.pyenv/plugins/pyenv-virtualenv/shims:~/.pyenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin and
    Path value is undefined
01:55:48.334 [debug] Getting activated env variables, Class name = Ip, completed in 1ms, has a truthy return value, Arg 1: "~/lichess/test_interrupt.ipynb", Arg 2: "~/.pyenv/versions/miniconda3-3.11-23.11.0-2/bin/python", Arg 3: undefined
01:55:48.349 [info] Process Execution: ~/.pyenv/versions/miniconda3-3.11-23.11.0-2/bin/python -c "import ipykernel; print(ipykernel.__version__); print("5dc3a68c-e34e-4080-9c3e-2a532b2ccb4d"); print(ipykernel.__file__)"
01:55:48.366 [debug] Launching kernel .jvsc74a57bd049169f8013b1c4a348b385264fb83aa338acd62288944654d64458e1964c50ae.~/.pyenv/versions/miniconda3-3.11-23.11.0-2/python.~/.pyenv/versions/miniconda3-3.11-23.11.0-2/python.-m#ipykernel_launcher for ~/lichess/test_interrupt.ipynb in ~/lichess with ports 9010, 9008, 9013, 9011, 9012
01:55:48.369 [debug] Kernel Env Variables for ~/.vscode-server/extensions/ms-toolsai.jupyter-2023.11.1003402403-linux-arm64/temp/jupyter/kernels/pythonjvsc74a57bd049169f8013b1c4a348b385264fb83aa338acd62288944654d64458e1964c50ae/kernel.json, PATH value is ~/.pyenv/versions/miniconda3-3.11-23.11.0-2/bin:~/.pyenv/versions/miniconda3-3.11-23.11.0-2/condabin:~/.pyenv/versions/miniconda3-3.11-23.11.0-2/bin:~/.pyenv/libexec:~/.pyenv/plugins/python-build/bin:~/.pyenv/plugins/pyenv-virtualenv/bin:~/.pyenv/plugins/pyenv-update/bin:~/.pyenv/plugins/pyenv-doctor/bin:~/.vscode-server/bin/0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2/bin/remote-cli:~/.pyenv/plugins/pyenv-virtualenv/shims:~/.pyenv/shims:~/.pyenv/bin:~/.pyenv/plugins/pyenv-virtualenv/shims:~/.pyenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
01:55:48.387 [info] Process Execution: ~/.pyenv/versions/miniconda3-3.11-23.11.0-2/bin/python -m ipykernel_launcher --f=~/.local/share/jupyter/runtime/kernel-v2-302303G2WoLubPqHDa.json
    > cwd: ~/lichess
01:55:48.545 [debug] Attempting to determine version of IPyWidgets
01:55:48.545 [debug] Attempting to determine version of IPyWidgets
01:55:48.545 [debug] Waiting for IPyWidgets version
01:55:48.545 [debug] Waiting for IPyWidgets version promise
01:55:48.545 [debug] Waiting for IPyWidgets version
01:55:48.545 [debug] Waiting for IPyWidgets version promise
01:55:48.562 [debug] ipykernel version & path 6.28.0, ~/.pyenv/versions/miniconda3-3.11-23.11.0-2/lib/python3.11/site-packages/ipykernel/__init__.py for ~/.pyenv/versions/miniconda3-3.11-23.11.0-2/bin/python
01:55:48.883 [warn] StdErr from Kernel Process 0.00s - Debugger warning: It seems that frozen modules are being used, which may
0.00s - make the debugger miss breakpoints. Please pass -Xfrozen_modules=off
0.00s - to python to disable frozen modules.
0.00s - Note: Debugging will proceed. Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation.
01:55:48.883 [debug] KernelProcess error: 0.00s - Debugger warning: It seems that frozen modules are being used, which may
0.00s - make the debugger miss breakpoints. Please pass -Xfrozen_modules=off
0.00s - to python to disable frozen modules.
0.00s - Note: Debugging will proceed. Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation.

01:55:48.951 [debug] Kernel output: NOTE: When using the `ipython kernel` entry point, Ctrl-C will not work.

To exit, you will have to explicitly quit this process, by either sending
"quit" from a client, or using Ctrl-\ in UNIX-like environments.

To read more about this, see https://github.com/ipython/ipython/issues/2049

To connect another client to this kernel, use:
    --existing kernel-v2-302303G2WoLubPqHDa.json

01:55:48.997 [debug] Waiting for Raw Session to be ready in postStartRawSession
01:55:48.997 [debug] Waiting for Raw session to be ready, status: connected
01:55:48.997 [debug] Raw session connected
01:55:48.997 [debug] Waiting for Raw session to be ready
01:55:48.997 [debug] Waited for Raw session to be ready & got status: connected
01:55:48.997 [debug] Successfully waited for Raw Session to be ready in postStartRawSession
01:55:48.997 [debug] Kernel status is 'unknown' before requesting kernel info and after ready
01:55:48.997 [debug] Sending request for kernelInfo
01:55:49.007 [debug] Got response for requestKernelInfo
01:55:49.007 [debug] Successfully completed postStartRawSession
01:55:49.008 [debug] Executing silently Code (idle) = import sys as _VSCODE_sys\nprint(_VSCODE_sys.executable); del _VSCODE_sys
01:55:49.020 [debug] Executing silently Code (completed) = import sys as _VSCODE_sys\nprint(_VSCODE_sys.executable); del _VSCODE_sys with 1 output(s)
01:55:49.020 [debug] End sendTelemetryForPythonKernelExecutable after 12ms
01:55:49.020 [debug] Started running kernel initialization for ~/lichess/test_interrupt.ipynb
01:55:49.020 [debug] Executing silently Code (idle) = try:\nimport ipywidgets as _VSCODE_ipywidgets\nprint("e976ee50-99ed-4aba-9b6b-9dcd5634d07d:IPy
01:55:49.089 [debug] Executing silently Code (completed) = try:\nimport ipywidgets as _VSCODE_ipywidgets\nprint("e976ee50-99ed-4aba-9b6b-9dcd5634d07d:IPy with 1 output(s)
01:55:49.089 [debug] Determined IPyWidgets Version as 8
01:55:49.089 [debug] Version of IPyWidgets 8 determined after 0.768s
01:55:49.089 [debug] Version of IPyWidgets 8 determined after 0.544s
01:55:49.089 [debug] Version of IPyWidgets 8 determined after 0.764s
01:55:49.089 [debug] Version of IPyWidgets 8 determined after 0.544s
01:55:49.091 [debug] Executing silently Code (idle) = import os as _VSCODE_os\nimport sys as _VSCODE_sys\n%cd "/~/lichess"\nif _VSCODE_os.getcwd() not in
01:55:49.103 [debug] Executing silently Code (completed) = import os as _VSCODE_os\nimport sys as _VSCODE_sys\n%cd "/~/lichess"\nif _VSCODE_os.getcwd() not in with 1 output(s)
01:55:49.104 [debug] Requesting Kernel info
01:55:49.104 [debug] Got Kernel info
01:55:49.104 [debug] End running kernel initialization, now waiting for idle
01:55:49.104 [debug] Waiting for idle on (kernel): eff10548-13d6-4a7e-a67c-dec63433371a -> idle
01:55:49.105 [debug] Finished waiting for idle on (kernel): eff10548-13d6-4a7e-a67c-dec63433371a -> idle
01:55:49.105 [debug] End running kernel initialization, session is idle
01:55:49.105 [debug] IPyWidgetMessageDispatcher.initialize
01:55:49.105 [debug] IPyWidgetScriptSource.initialize
01:55:49.757 [debug] IPyWidgetMessageDispatcher.initialize
01:55:49.757 [debug] Web view is ready to receive widget messages
01:55:49.757 [debug] IPyWidgetMessageDispatcher.initialize
01:55:49.757 [debug] Web view is ready to receive widget messages
01:55:49.826 [debug] Widget Message: Received IPyWidgets_kernelOptions in ScriptManager
01:55:49.826 [debug] Widget Message: Received IPyWidgets_kernelOptions in ScriptManager
01:55:49.827 [debug] Widget Message: Received IPyWidgetMessages.IPyWidgets_kernelOptions
01:55:49.827 [debug] Widget Message: Received IPyWidgetMessages.IPyWidgets_kernelOptions
01:55:49.829 [debug] IPyWidgetMessageDispatcher.initialize
01:55:49.829 [debug] IPyWidgetMessageDispatcher.initialize
01:55:49.830 [debug] IPyWidgetMessageDispatcher.initialize
01:55:49.830 [debug] IPyWidgetMessageDispatcher.initialize
01:55:49.832 [debug] Widget Message: data-base-url set to https://vscode-remote%2Bssh-002dremote-002b95-002e217-002e3-002e198.vscode-resource.vscode-cdn.net~/.vscode-server/extensions/ms-toolsai.jupyter-2023.11.1003402403-linux-arm64/temp/scripts/123cff2cc44fec9f53080a5a0f8702fcb80d625d64edf87fd2c5bddd2df0d658/jupyter
01:55:49.832 [debug] Widget Message: data-base-url set to https://vscode-remote%2Bssh-002dremote-002b95-002e217-002e3-002e198.vscode-resource.vscode-cdn.net~/.vscode-server/extensions/ms-toolsai.jupyter-2023.11.1003402403-linux-arm64/temp/scripts/123cff2cc44fec9f53080a5a0f8702fcb80d625d64edf87fd2c5bddd2df0d658/jupyter
01:55:49.833 [debug] Widget Message: Received IPyWidgets_kernelOptions in ScriptManager
01:55:49.833 [debug] Widget Message: Received IPyWidgets_kernelOptions in ScriptManager
01:55:49.833 [debug] Widget Message: Received IPyWidgetMessages.IPyWidgets_kernelOptions
01:55:49.833 [debug] Widget Message: Received IPyWidgetMessages.IPyWidgets_kernelOptions
01:55:49.833 [debug] Widget Message: Received IPyWidgets_kernelOptions in ScriptManager
01:55:49.833 [debug] Widget Message: Received IPyWidgets_kernelOptions in ScriptManager
01:55:49.833 [debug] Widget Message: Received IPyWidgetMessages.IPyWidgets_kernelOptions
01:55:49.833 [debug] Widget Message: Received IPyWidgetMessages.IPyWidgets_kernelOptions
01:55:49.833 [debug] Widget Message: data-base-url set to https://vscode-remote%2Bssh-002dremote-002b95-002e217-002e3-002e198.vscode-resource.vscode-cdn.net~/.vscode-server/extensions/ms-toolsai.jupyter-2023.11.1003402403-linux-arm64/temp/scripts/123cff2cc44fec9f53080a5a0f8702fcb80d625d64edf87fd2c5bddd2df0d658/jupyter
01:55:49.833 [debug] Widget Message: data-base-url set to https://vscode-remote%2Bssh-002dremote-002b95-002e217-002e3-002e198.vscode-resource.vscode-cdn.net~/.vscode-server/extensions/ms-toolsai.jupyter-2023.11.1003402403-linux-arm64/temp/scripts/123cff2cc44fec9f53080a5a0f8702fcb80d625d64edf87fd2c5bddd2df0d658/jupyter
01:56:37.739 [info] Handle Execution of Cells 3 for ~/lichess/test_interrupt.ipynb
01:56:37.743 [debug] Cell Index:3 sent to kernel
01:56:37.752 [debug] Start cell 3 execution @ 1704678997752 (clear output)
01:56:37.753 [info] Kernel acknowledged execution of cell 3 @ 1704678997752
01:56:39.869 [debug] VS Code interrupted kernel for ~/lichess/test_interrupt.ipynb
01:56:39.870 [debug] Command interrupted kernel for ~/lichess/test_interrupt.ipynb
01:56:39.871 [debug] interrupt the kernel, options.disableUI=false for ~/lichess/test_interrupt.ipynb
01:56:39.871 [info] Interrupt kernel execution
01:56:39.871 [debug] Cancel pending cells
01:56:39.873 [info] Interrupt requested ~/lichess/test_interrupt.ipynb
01:56:39.874 [info] Interrupt kernel execution
01:56:39.874 [info] Interrupting kernel: pythonjvsc74a57bd049169f8013b1c4a348b385264fb83aa338acd62288944654d64458e1964c50ae
01:56:39.874 [info] Interrupting kernel via SIGINT
01:56:39.982 [info] End cell 3 execution after 2.23s, completed @ 1704678999982, started @ 1704678997752
01:56:39.982 [debug] Cell 3 executed with state Success
01:56:39.984 [info] Interrupt requested & sent for ~/lichess/test_interrupt.ipynb in notebookEditor.
01:56:40.281 [debug] Start cell 3 execution @ undefined
01:56:40.283 [info] End cell 3 execution after 1704678999.982s, completed @ 1704678999982, started @ undefined
01:56:40.781 [debug] Start cell 3 execution @ undefined
01:56:40.782 [info] End cell 3 execution after 0s, completed @ undefined, started @ undefined
01:56:41.281 [debug] Start cell 3 execution @ undefined
01:56:41.282 [info] End cell 3 execution after 0s, completed @ undefined, started @ undefined
01:56:41.782 [debug] Start cell 3 execution @ undefined
01:56:41.783 [info] End cell 3 execution after 0s, completed @ undefined, started @ undefined
01:56:42.283 [debug] Start cell 3 execution @ undefined
01:56:42.284 [info] End cell 3 execution after 0s, completed @ undefined, started @ undefined
01:56:42.782 [debug] Start cell 3 execution @ undefined
01:56:42.782 [info] End cell 3 execution after 0s, completed @ undefined, started @ undefined
01:56:43.283 [debug] Start cell 3 execution @ undefined
01:56:43.284 [info] End cell 3 execution after 0s, completed @ undefined, started @ undefined
01:56:43.783 [debug] Start cell 3 execution @ undefined
01:56:43.783 [info] End cell 3 execution after 0s, completed @ undefined, started @ undefined
01:56:44.283 [debug] Start cell 3 execution @ undefined
01:56:44.284 [info] End cell 3 execution after 0s, completed @ undefined, started @ undefined
01:56:44.784 [debug] Start cell 3 execution @ undefined
01:56:44.785 [info] End cell 3 execution after 0s, completed @ undefined, started @ undefined
01:56:45.284 [debug] Start cell 3 execution @ undefined
01:56:45.285 [info] End cell 3 execution after 0s, completed @ undefined, started @ undefined
01:56:45.783 [debug] Start cell 3 execution @ undefined
01:56:45.783 [info] End cell 3 execution after 0s, completed @ undefined, started @ undefined
01:56:46.283 [debug] Start cell 3 execution @ undefined
01:56:46.284 [info] End cell 3 execution after 0s, completed @ undefined, started @ undefined
01:56:46.784 [debug] Start cell 3 execution @ undefined
01:56:46.785 [info] End cell 3 execution after 0s, completed @ undefined, started @ undefined
01:56:47.285 [debug] Start cell 3 execution @ undefined
01:56:47.286 [info] End cell 3 execution after 0s, completed @ undefined, started @ undefined
01:56:47.784 [debug] Start cell 3 execution @ undefined
01:56:47.785 [info] End cell 3 execution after 0s, completed @ undefined, started @ undefined

Hey @DonJayamanne, this issue might need further attention.
@stas-sl, you can help us out by closing this issue if the problem no longer exists, or adding more information.

Note to self
We might be missing the equivalent of _send_interrupt_children in kernelbase.py
    def _send_interrupt_children(self):
        if os.name == "nt":
            self.log.error("Interrupt message not supported on Windows")
        else:
            pid = os.getpid()
            pgid = os.getpgid(pid)
            # Prefer process-group over process
            # but only if the kernel is the leader of the process group
            if pgid and pgid == pid and hasattr(os, "killpg"):
                try:
                    os.killpg(pgid, SIGINT)
                except OSError:
                    os.kill(pid, SIGINT)
                    raise
            else:
                os.kill(pid, SIGINT)

authors: DonJayamanne VSCodeTriageBot stas-sl

repo: microsoft/vscode-jupyter


text:
Unable to import NumPy using VSCode Jupyter Notebook extension

Environment data

VS Code version:  1.57
Jupyter Extension version (available under the Extensions sidebar): v2021.6.999406279
Python Extension version (available under the Extensions sidebar): v2021.5.926500501
OS (Windows | Mac | Linux distro) and version: Windows 10
Python and/or Anaconda version: Python 3.7.10, conda 4.10.1, numpy 1.19.1
Type of virtual environment used (N/A | venv | virtualenv | conda | ...): conda
Jupyter server running: Local

Expected behaviour
import numpy successfully
Actual behaviour
ImportError: DLL load failed: The specified module could not be found.
Steps to reproduce:

Open Jupyter notebook in VSCode with conda env activated

Attempt to import numpy

Logs

C:\Users\dylan\Anaconda3\lib\site-packages\numpy_init_.py:138: UserWarning: mkl-service package failed to import, therefore Intel(R) MKL initialization ensuring its correct out-of-the box operation under condition when Gnu OpenMP had already been loaded by Python process is not assured. Please install mkl-service package, see http://github.com/IntelPython/mkl-service
from . import _distributor_init
ImportError                               Traceback (most recent call last)
~\Anaconda3\lib\site-packages\numpy\core_init_.py in
21 try:
---> 22     from . import multiarray
23 except ImportError as exc:
~\Anaconda3\lib\site-packages\numpy\core\multiarray.py in
11
---> 12 from . import overrides
13 from . import _multiarray_umath
~\Anaconda3\lib\site-packages\numpy\core\overrides.py in
6
----> 7 from numpy.core._multiarray_umath import (
8     add_docstring, implement_array_function, _get_implementing_args)
ImportError: DLL load failed: The specified module could not be found.
During handling of the above exception, another exception occurred:
ImportError                               Traceback (most recent call last)
 in
----> 1 import numpy
~\Anaconda3\lib\site-packages\numpy_init_.py in
138     from . import _distributor_init
139
--> 140     from . import core
141     from .core import *
142     from . import compat
~\Anaconda3\lib\site-packages\numpy\core_init_.py in
46 """ % (sys.version_info[0], sys.version_info[1], sys.executable,
47         version, exc)
---> 48     raise ImportError(msg)
49 finally:
50     for envkey in env_added:
ImportError:
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.
We have compiled some common reasons and troubleshooting tips at:
https://numpy.org/devdocs/user/troubleshooting-importerror.html

Please note and check the following:

The Python version is: Python3.7 from "C:\Users\dylan\Anaconda3\python.exe"
The NumPy version is: "1.19.1"

and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.
Original error was: DLL load failed: The specified module could not be found.
(View→Output, change the drop-down the upper-right of the Output panel to Jupyter)

Info 2021-06-16 12:21:13: Executing cell 167426b3-8f06-4b6a-95ce-7a22e961e348
Info 2021-06-16 12:21:13: Submitting code for 3ce6dc9a-8ea8-42cf-9aa9-bcae4c4ffb1a
Info 2021-06-16 12:21:13: UpdateWorkingDirectoryAndPath
Info 2021-06-16 12:21:13: changeDirectoryIfPossible
Info 2021-06-16 12:21:13: Kernel switching to busy
Info 2021-06-16 12:21:13: Kernel switching to idle
Info 2021-06-16 12:21:13: Preferred kernel for untitled:/c%3A/Users/dylan/Documents/Python_scripts/UCL/Untitled-2.ipynb is undefined
Info 2021-06-16 12:21:13: Kernel switching to busy
Info 2021-06-16 12:21:13: Preferred kernel for untitled:/c%3A/Users/dylan/Documents/Python_scripts/UCL/Untitled-2.ipynb is undefined
Info 2021-06-16 12:21:13: Preferred kernel for untitled:/c%3A/Users/dylan/Documents/Python_scripts/UCL/Untitled-2.ipynb is undefined
Info 2021-06-16 12:21:14: Preferred kernel for untitled:/c%3A/Users/dylan/Documents/Python_scripts/UCL/Untitled-2.ipynb is undefined
Info 2021-06-16 12:21:14: Finished execution for 167426b3-8f06-4b6a-95ce-7a22e961e348
Info 2021-06-16 12:21:14: Finished executing cell 167426b3-8f06-4b6a-95ce-7a22e961e348
Info 2021-06-16 12:21:14: Kernel switching to idle

Thanks for the bug. This doesn't seem to be a problem with the jupyter extension, but rather your python environment.
This SO issue sounds like what your problem is:
https://stackoverflow.com/questions/36778066/importerror-dll-load-failed-when-importing-numpy-installed-in-conda-virtual-env

@rchiodo Thanks for looking at the issue.
I believe it is a jupyter extension issue as the numpy import works fine in an ipython terminal.
The suggestions in the link do not help me resolve the issue.

That might happen if the kernel we're running is not the same environment as where you're running IPython.
Can you verify it's the same environment? For example, run
import sys
print(sys.executable)

in both to see if they match.
If those match, then check sys.path and os.environ

Hi Rich,
For whatever reason the import is now successful.. I'm not sure which step in particular did this.
Nonetheless, thanks very much for your help!
They were indeed the same executable running in IPython and Jupyter.
Best wishes,
Dylan

From: Rich Chiodo @.>
Sent: 16 June 2021 16:48
To: microsoft/vscode-jupyter @.>
Cc: dylan-behr @.>; Author @.>
Subject: Re: [microsoft/vscode-jupyter] Unable to import NumPy using VSCode Jupyter Notebook extension (#6306)
That might happen if the kernel we're running is not the same environment as where you're running IPython.
Can you verify it's the same environment? For example, run
import sys
print(sys.executable)
in both to see if they match.
If those match, then check sys.path and os.environ
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHubhttps://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmicrosoft%2Fvscode-jupyter%2Fissues%2F6306%23issuecomment-862492623&data=04|01||1709bb9696b44a5db18308d930de3903|84df9e7fe9f640afb435aaaaaaaaaaaa|1|0|637594553251696599|Unknown|TWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D|1000&sdata=1remU6YoD2%2F1ugbbXQdB74xKXT5uauIawraS3qruFZ8%3D&reserved=0, or unsubscribehttps://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAK3W5JTGCVY24RGO6BS33V3TTDBVXANCNFSM46ZHFZDA&data=04|01||1709bb9696b44a5db18308d930de3903|84df9e7fe9f640afb435aaaaaaaaaaaa|1|0|637594553251696599|Unknown|TWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D|1000&sdata=fS%2FXVewra2JvcK2eiccauDZ52YTAmU%2F1UirZV7gFszA%3D&reserved=0.

Dear Rich,
I've encountered the same error again but with matplotlib i.e. ImportError: DLL load failed.
In VSCode Jupyter extension I am using the same executable as in my IPython terminal (sys.executable returns 'C:\Users\dylan\Anaconda3\python.exe')
However sys.path returns differently:
VSCode:
'c:\Users\dylan\Documents\Python_scripts\UCL',
'c:\Users\dylan\.vscode\extensions\ms-toolsai.jupyter-2021.6.999406279\pythonFiles',
'c:\Users\dylan\.vscode\extensions\ms-toolsai.jupyter-2021.6.999406279\pythonFiles\lib\python',
'C:\Users\dylan\Anaconda3\python37.zip',
'C:\Users\dylan\Anaconda3\DLLs',
'C:\Users\dylan\Anaconda3\lib',
'C:\Users\dylan\Anaconda3',
'',
'C:\Users\dylan\AppData\Roaming\Python\Python37\site-packages',
'C:\Users\dylan\AppData\Roaming\Python\Python37\site-packages\win32',
'C:\Users\dylan\AppData\Roaming\Python\Python37\site-packages\win32\lib',
'C:\Users\dylan\AppData\Roaming\Python\Python37\site-packages\Pythonwin',
'C:\Users\dylan\Anaconda3\lib\site-packages',
'C:\Users\dylan\Anaconda3\lib\site-packages\win32',
'C:\Users\dylan\Anaconda3\lib\site-packages\win32\lib',
'C:\Users\dylan\Anaconda3\lib\site-packages\Pythonwin',
'C:\Users\dylan\AppData\Roaming\Python\Python37\site-packages\IPython\extensions',
'C:\Users\dylan\.ipython'
IPython:
'C:\Users\dylan\Anaconda3\Scripts',
'C:\Users\dylan\Anaconda3\python37.zip',
'C:\Users\dylan\Anaconda3\DLLs',
'C:\Users\dylan\Anaconda3\lib',
'C:\Users\dylan\Anaconda3',
'',
'C:\Users\dylan\AppData\Roaming\Python\Python37\site-packages',
'C:\Users\dylan\AppData\Roaming\Python\Python37\site-packages\win32',
'C:\Users\dylan\AppData\Roaming\Python\Python37\site-packages\win32\lib',
'C:\Users\dylan\AppData\Roaming\Python\Python37\site-packages\Pythonwin',
'C:\Users\dylan\Anaconda3\lib\site-packages',
'C:\Users\dylan\Anaconda3\lib\site-packages\win32',
'C:\Users\dylan\Anaconda3\lib\site-packages\win32\lib',
'C:\Users\dylan\Anaconda3\lib\site-packages\Pythonwin',
'C:\Users\dylan\AppData\Roaming\Python\Python37\site-packages\IPython\extensions',
'C:\Users\dylan\.ipython'
Should I add the missing 'C:\Users\dylan\Anaconda3\Scripts' to my VSCode path?
os.environ returns an item
'PYTHONPATH': 'c:\Users\dylan\.vscode\extensions\ms-toolsai.jupyter-2021.6.999406279\pythonFiles;c:\Users\dylan\.vscode\extensions\ms-toolsai.jupyter-2021.6.999406279\pythonFiles\lib\python'
amongst other items - is this also a problem?
Best,
Dylan

From: Rich Chiodo @.>
Sent: 16 June 2021 16:48
To: microsoft/vscode-jupyter @.>
Cc: dylan-behr @.>; Author @.>
Subject: Re: [microsoft/vscode-jupyter] Unable to import NumPy using VSCode Jupyter Notebook extension (#6306)
That might happen if the kernel we're running is not the same environment as where you're running IPython.
Can you verify it's the same environment? For example, run
import sys
print(sys.executable)
in both to see if they match.
If those match, then check sys.path and os.environ
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHubhttps://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmicrosoft%2Fvscode-jupyter%2Fissues%2F6306%23issuecomment-862492623&data=04|01||1709bb9696b44a5db18308d930de3903|84df9e7fe9f640afb435aaaaaaaaaaaa|1|0|637594553251696599|Unknown|TWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D|1000&sdata=1remU6YoD2%2F1ugbbXQdB74xKXT5uauIawraS3qruFZ8%3D&reserved=0, or unsubscribehttps://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAK3W5JTGCVY24RGO6BS33V3TTDBVXANCNFSM46ZHFZDA&data=04|01||1709bb9696b44a5db18308d930de3903|84df9e7fe9f640afb435aaaaaaaaaaaa|1|0|637594553251696599|Unknown|TWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D|1000&sdata=fS%2FXVewra2JvcK2eiccauDZ52YTAmU%2F1UirZV7gFszA%3D&reserved=0.

PYTHONPATH should have those items added. That's how we load internal python modules.
The missing syspath thing is weird though. Not sure how this one isn't showing up:
C:\\Users\\dylan\\Anaconda3\\Scripts

That might be conda init? Conda init has to be run with the shell we're using to start the kernel with. It might be you haven't run it yet? And so when we try to get the conda environment something is missing.
Can you try running
conda init cmd.exe
conda init powershell

From an anaconda prompt, then try running VS code again and see if the sys path is fixed?
If that doesn't work you can add that scripts path manually.

Hi Rich,
I tried running the commands you suggested and they returned the following:
(base) C:\Users\dylan>conda init cmd.exe
no change     C:\Users\dylan\Anaconda3\Scripts\conda.exe
no change     C:\Users\dylan\Anaconda3\Scripts\conda-env.exe
no change     C:\Users\dylan\Anaconda3\Scripts\conda-script.py
no change     C:\Users\dylan\Anaconda3\Scripts\conda-env-script.py
no change     C:\Users\dylan\Anaconda3\condabin\conda.bat
no change     C:\Users\dylan\Anaconda3\Library\bin\conda.bat
no change     C:\Users\dylan\Anaconda3\condabin_conda_activate.bat
no change     C:\Users\dylan\Anaconda3\condabin\rename_tmp.bat
no change     C:\Users\dylan\Anaconda3\condabin\conda_auto_activate.bat
no change     C:\Users\dylan\Anaconda3\condabin\conda_hook.bat
no change     C:\Users\dylan\Anaconda3\Scripts\activate.bat
no change     C:\Users\dylan\Anaconda3\condabin\activate.bat
no change     C:\Users\dylan\Anaconda3\condabin\deactivate.bat
no change     C:\Users\dylan\Anaconda3\Scripts\activate
no change     C:\Users\dylan\Anaconda3\Scripts\deactivate
no change     C:\Users\dylan\Anaconda3\etc\profile.d\conda.sh
no change     C:\Users\dylan\Anaconda3\etc\fish\conf.d\conda.fish
no change     C:\Users\dylan\Anaconda3\shell\condabin\Conda.psm1
no change     C:\Users\dylan\Anaconda3\shell\condabin\conda-hook.ps1
no change     C:\Users\dylan\Anaconda3\Lib\site-packages\xontrib\conda.xsh
no change     C:\Users\dylan\Anaconda3\etc\profile.d\conda.csh
modified      HKEY_CURRENT_USER\Software\Microsoft\Command Processor\AutoRun
==> For changes to take effect, close and re-open your current shell. <==
(base) C:\Users\dylan>conda init powershell
no change     C:\Users\dylan\Anaconda3\Scripts\conda.exe
no change     C:\Users\dylan\Anaconda3\Scripts\conda-env.exe
no change     C:\Users\dylan\Anaconda3\Scripts\conda-script.py
no change     C:\Users\dylan\Anaconda3\Scripts\conda-env-script.py
no change     C:\Users\dylan\Anaconda3\condabin\conda.bat
no change     C:\Users\dylan\Anaconda3\Library\bin\conda.bat
no change     C:\Users\dylan\Anaconda3\condabin_conda_activate.bat
no change     C:\Users\dylan\Anaconda3\condabin\rename_tmp.bat
no change     C:\Users\dylan\Anaconda3\condabin\conda_auto_activate.bat
no change     C:\Users\dylan\Anaconda3\condabin\conda_hook.bat
no change     C:\Users\dylan\Anaconda3\Scripts\activate.bat
no change     C:\Users\dylan\Anaconda3\condabin\activate.bat
no change     C:\Users\dylan\Anaconda3\condabin\deactivate.bat
no change     C:\Users\dylan\Anaconda3\Scripts\activate
no change     C:\Users\dylan\Anaconda3\Scripts\deactivate
no change     C:\Users\dylan\Anaconda3\etc\profile.d\conda.sh
no change     C:\Users\dylan\Anaconda3\etc\fish\conf.d\conda.fish
no change     C:\Users\dylan\Anaconda3\shell\condabin\Conda.psm1
no change     C:\Users\dylan\Anaconda3\shell\condabin\conda-hook.ps1
no change     C:\Users\dylan\Anaconda3\Lib\site-packages\xontrib\conda.xsh
no change     C:\Users\dylan\Anaconda3\etc\profile.d\conda.csh
no change     C:\Users\dylan\OneDrive\Documents\WindowsPowerShell\profile.ps1
No action taken.
After closing and reopening the anaconda prompt again for the changes to take effect, I found I had no functional anaconda terminal and just showed this:
[cid:dd7de4c6-b4fc-477e-bb55-c5e40b51c054]
However it did fix all the problem encountered importing modules in a VSCode window, but still hasnt added
C:\Users\dylan\Anaconda3\Scripts
to the pythonpath - sys.path returns:
['c:\Users\dylan\AppData\Local\Temp',
'c:\Users\dylan\.vscode\extensions\ms-toolsai.jupyter-2021.6.999406279\pythonFiles\vscode_datascience_helpers',
'c:\Users\dylan\.vscode\extensions\ms-toolsai.jupyter-2021.6.999406279\pythonFiles',
'c:\Users\dylan\.vscode\extensions\ms-toolsai.jupyter-2021.6.999406279\pythonFiles\lib\python',
'C:\Users\dylan\Anaconda3\python37.zip',
'C:\Users\dylan\Anaconda3\DLLs',
'C:\Users\dylan\Anaconda3\lib',
'C:\Users\dylan\Anaconda3',
'',
'C:\Users\dylan\AppData\Roaming\Python\Python37\site-packages',
'C:\Users\dylan\AppData\Roaming\Python\Python37\site-packages\win32',
'C:\Users\dylan\AppData\Roaming\Python\Python37\site-packages\win32\lib',
'C:\Users\dylan\AppData\Roaming\Python\Python37\site-packages\Pythonwin',
'C:\Users\dylan\Anaconda3\lib\site-packages',
'C:\Users\dylan\Anaconda3\lib\site-packages\win32',
'C:\Users\dylan\Anaconda3\lib\site-packages\win32\lib',
'C:\Users\dylan\Anaconda3\lib\site-packages\Pythonwin',
'C:\Users\dylan\AppData\Roaming\Python\Python37\site-packages\IPython\extensions',
'C:\Users\dylan\.ipython']
On opening my registry editor I found the conda init commands had added an 'Autorun' registry as shown:
[cid:d4785ece-5e26-46c8-b4cf-dc3782090098]
I found adding the scripts path manually with sys.path.insert(0,'C:\Users\dylan\Anaconda3\Scripts') has no effect on the import ability of python in a VSCode jupyter notebook.
In summary, it seems that I need to run the conda init commands in order to add some registry allowing me to import modules correctly in jupyter notebook on VSCode. However I would need to delete said registry every time i wanted to use anaconda prompt to open a web browser based jupyter notebook.
This is workable but ultimately a little clunky and inconvenient: Is there some way to fix this?
Best wishes,
Dylan

From: Rich Chiodo @.>
Sent: 18 June 2021 21:51
To: microsoft/vscode-jupyter @.>
Cc: dylan-behr @.>; Author @.>
Subject: Re: [microsoft/vscode-jupyter] Unable to import NumPy using VSCode Jupyter Notebook extension (#6306)
PYTHONPATH should have those items added. That's how we load internal python modules.
The missing syspath thing is weird though. Not sure how this one isn't showing up:
C:\Users\dylan\Anaconda3\Scripts
That might be conda init? Conda init has to be run with the shell we're using to start the kernel with. It might be you haven't run it yet? And so when we try to get the conda environment something is missing.
Can you try running
conda init cmd.exe
conda init powershell
From an anaconda prompt, then try running VS code again and see if the sys path is fixed?
If that doesn't work you can add that scripts path manually.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHubhttps://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmicrosoft%2Fvscode-jupyter%2Fissues%2F6306%23issuecomment-864267542&data=04|01||62ddc1aceae0457d953408d9329ad004|84df9e7fe9f640afb435aaaaaaaaaaaa|1|0|637596462754149724|Unknown|TWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D|1000&sdata=9f5EFUO9plhlV8DvlW%2BxWmbdOQ%2B27TzyIJJlJz7mEIY%3D&reserved=0, or unsubscribehttps://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAK3W5JR6MPCXD5U52VEPLQ3TTOWUDANCNFSM46ZHFZDA&data=04|01||62ddc1aceae0457d953408d9329ad004|84df9e7fe9f640afb435aaaaaaaaaaaa|1|0|637596462754159676|Unknown|TWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D|1000&sdata=dYhTeulXCxWqFm1mQuLozIRAIJiLK27Mlriv0VoChFI%3D&reserved=0.

So I think you're saying running conda init cmd.exe and conda init powershell has broken the anaconda prompt? That sounds like you should log a bug on anaconda. That certainly shouldn't break your anaconda prompt. And it's the recommended method for using anaconda (and what we recommend if anaconda isn't working).

Thank you Rich, I have logged a bug on anaconda.
Best,
Dylan

From: Rich Chiodo @.>
Sent: 23 June 2021 17:10
To: microsoft/vscode-jupyter @.>
Cc: dylan-behr @.>; Author @.>
Subject: Re: [microsoft/vscode-jupyter] Unable to import NumPy using VSCode Jupyter Notebook extension (#6306)
So I think you're saying running conda init cmd.exe and conda init powershell has broken the anaconda prompt? That sounds like you should log a bug on anaconda. That certainly shouldn't break your anaconda prompt. And it's the recommended method for using anaconda (and what we recommend if anaconda isn't working).
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHubhttps://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmicrosoft%2Fvscode-jupyter%2Fissues%2F6306%23issuecomment-866973167&data=04|01||d14415f481954c3219bb08d936616e04|84df9e7fe9f640afb435aaaaaaaaaaaa|1|0|637600614343879514|Unknown|TWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D|1000&sdata=OhaoF4%2FQgIUjTzSo%2BLayL6pZ0aegnMAgJQP2M0mIBko%3D&reserved=0, or unsubscribehttps://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAK3W5JQHK4T5ZDMVE2UA533TUIBPRANCNFSM46ZHFZDA&data=04|01||d14415f481954c3219bb08d936616e04|84df9e7fe9f640afb435aaaaaaaaaaaa|1|0|637600614343889469|Unknown|TWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D|1000&sdata=zbVUdExeL%2BlxT%2FkH9RJDnIF6qLLOz1zc1UZrmvAgPGg%3D&reserved=0.

authors: dylan-behr rchiodo


text:
Adopt new Python extensions non-blocking API for interpreter disocvery

Three discovery APIs are being added for Jupyter which is meant to replace existing getInterpreters() API: https://github.com/microsoft/vscode-python/pull/17452
type PythonApiForJupyterExtension = {
     ...
    /**
     * IInterpreterService
     */
    readonly refreshPromise: Promise<void> | undefined;
    /**
     * IInterpreterService
     */
    readonly onDidChangeInterpreters: Event<PythonEnvironmentsChangedEvent>;
    /**
     * Equivalent to getInterpreters() in IInterpreterService
     */
    getKnownInterpreters(resource?: Uri): PythonEnvironment[];
    /**
     * Equivalent to getAllInterpreters() in IInterpreterService
     */
    getInterpreters(resource?: Uri): Promise<PythonEnvironment[]>;
    ...

Previous behavior:
Existing getInterpreters() is an asynchronus blocking API, so it waits until all of discovery is completed the first time it is called. Subsequent calls return instantaneously from cache if the same resource is queried again.
New behavior:

New getKnownInterpreters() simply returns whatever is currently in cache. It is useful when we do not need all of the interpreters at once, which is usually the case. In the Python extension we are able to replace all instances of getInterpreters() with getKnownInterpreters(). Do note that the kind info returned by this API may change as refresh progresses.
onDidChangeInterpreters fires when an environment gets added/removed/updated in cache. Event properties tracks the old and new environments accordingly.
Python extension triggers a refresh in background when the extension loads for the first time, which is when refreshPromise is set. It can be used to implement now deprecated getInterpreters() in the following way:

    /** Gets all interpreters **/
    public async getInterpreters(resource?: Uri): Promise<PythonEnvironment[]> {
        await this.refreshPromise; // Wait for the refresh to finish so that the cache contains all environments.
        return getKnownInterpreters(resource); // Return from cache.
    }

getInterpreterDetails() is still available as before, and can be used to get complete and reliable information on environments. As it is a blocking call, it's recommend to only use it if complete information is needed, which is generally only the case for selected interpreters.

You can the see the new API in action here in our dynamic quickpick https://github.com/microsoft/vscode-python/pull/17043#issue-975156935.

Note: Any internal interpreter list caching that was recently added should go away once onDidChangeInterpreters events are available.

Changes regarding quickpick API
We also used to expose getSuggestions API for the quickpick, which has the same problem as getInterpreters(). The following non-blocking API is being added to replace it:
getKnownSuggestions(resource: Resource): Promise<IInterpreterQuickPickItem[]>;

It can be used in combination of refreshPromise to get all suggestions. Let me know if you have any questions! 😄

@karrtikr just want to double check, this new API won't break existing users, right? If a user is on python insiders, but not updating the jupyter extension, they won't be broken because the old extension is still using the old API?

Yes, the old APIs are still available, the new APIs are added in addition.

FYI we plan to expose discovery API generally for all extensions and not just Jupyter, and it's a little different from this API. Proposed design: https://gist.github.com/karthiknadig/4b7bc9a9420e9071105007b5cc096f65
I'll leave it up-to you guys on whether you want to wait for the final API. This issue can be closed in that case.

You could compare the .path

That wouldn't work for since conda environments. If you create conda environments on unix, the python path is the same as the base conda env.( Unless you provide the python argument in the clip).

Interesting, can you link on how to create such environments? We're not handling such environments at the moment in the discovery component and completely rely on 'path', but weirdly haven't received any issue reports.

ndling such environments at the moment in the discovery component and completely rely

Ok, thanks. Weird. I thought we used to detect these.
If i'm not mistaken we've been using some internally as well for testing purposes.
Lets leave that for now then, if its not supported then thats a whole separate issue.
Hence please ignore the comments, i'll use the path as a key in personal & jupyter extension

@karrtikr just use conda create env -n <name>

Cool.

I thought we used to detect these.

We detected the environment folders, but we only looked for python paths inside the env folder:
    /**
     * Return the interpreter's filename for the given environment.
     */
    public getInterpreterPath(condaEnvironmentPath: string): string {
        // where to find the Python binary within a conda env.
        const relativePath = this.platform.isWindows ? 'python.exe' : path.join('bin', 'python');
        return path.join(condaEnvironmentPath, relativePath);
    }

so such environments with base conda python path were never discovered.

We actually didn't, we detected the environment folders, but we only looked for pytho

Interesting, @IanMatthewHuff how is it that yo'ure getting Jupyter environments listed in VS Code that don't have an executable? Referring to https://github.com/microsoft/vscode-jupyter/issues/5650

@DonJayamanne Not fully sure what you are referring to. In #5650 I'm just referring to multiple KernelConnectionMetadatas that all share a path.

@karrtikr I'd like to start this discussion again, given that the API has changed
Here is what we would like to have

We would like to popular the list of interpreters in our kernel picker as and when they are discovered.

E.g. if python extension discovers Conda Env A, then we add Conda Env A into the list of kernels, and then add Conda Env B after a few ms or seconds and so on .
Basically we'd like to add the envionments as and when they are added
We'd like information such as

Type of environment
Name of environment
Python Version of Environment
Whether its 32 bit or 64 bit

Please advice if this is possible today with the API or not, and what API methods/events we should be using this

Blocking/non-blocking

In a separate thread you have indicated that calling some of the API could block the extension code, like language servers etc.
My suggest would be to block the API to not return anything until all of the necessary components have loaded in the Python extension.
This way the jupyter extension or others can use the API anytime they need.
E.g. assume we create a jupyter extension thats very very fast tomorrow, and the code that runs to load interpreters executes pretty much as soon as extension loads, by now Python extension might still be loading. Hence if you would like the Python extension to NOT be blocked by an interpreter API call, then I'd suggest you block the API until the necessary components have loaded in python extension. This allows consumers of the extension API to use the API freely, else its difficult to predict and control how the API is called.
Also please note, the Jupyter extension needs the list of kernels quickly and we've found that things are slow in the past, hence its likely we'll still continue fetching the interpreters as soon as the jupyter extension loads, so as to improve the over all UX in jupyter extension.

But this remains to be seen, based on how fast the new API is

From what I can tell the new API has an event onDidEnvironmentsChanged,

Lets assume a user has 10 enviroments and the event is triggered for one of the envirionments.
Next we call getEnvironmentDetails with the above information & we do this for all 10 events triggered.
From what I can tell this is the way the API is meant to be used, I'd like to understand if there are any problems here with this approach.

if python extension discovers Conda Env A, then we add Conda Env A into the list of kernels, and then add Conda Env B after a few ms or seconds and so on .

Regarding first point, yes it's possible. But events are fired if any information is found even though it's not complete yet:

Event1: EnvA was found (not sure if it's conda yet)
Event2: Partial version was filled
Event3: Type detected as conda
Event4: Complete info is found

Are you interested in information in all these stages, or information when it's complete? I think for the purposes of populating the list, it's fine to have partial information so users could at least begin selecting it. Both of these are possible to fetch.

opulating the list, it's fine to have partial information so users could at least begin selecting it

Not sure i agree, displaying the wrong information to the user just because we have something would not be the best.
I say wrong, because we could end up displaying an environment as a virtual environment, when in fact its a conda environment or the like,
Hence in such cases, its possible the user is looking for a virtual env and we display a conda environment and when they attempt to run it, then things fall over, because they were expecting a virtual and they got a conda environment.
I think for Python extension it doesn't really matter much what the user chooses, in Jupyter it makes a very big difference, basically its a make or break selection. If you get it wrong, things will not work at all, where as in python ext thats not the case, most of the things will work.

Are you interested in information in all these stages, or information only when it's complete?

Basically we need the information before we add it to the list.
Lets take the following scenario into account
Event1: EnvA was found (not sure if it's conda yet)
Event2: Partial version was filled
Event3: Type detected as conda
Event4: Complete info is found

Lets assume we called the api method getEnvironmentDetails after Event2. Lets assume the envionment is detected as a virtual environment, but in fact its a Conda enviroment. Now after we get the resutls of the getEnvironmentDetails, would that point to the stable values? or is it possible that after we get the result for getEnvironmentDetails the events Event3, and Event4 can get fired again for the same environment.
Meaning the only time we can get the accurate information is to wait for everything to compete?
Or can we get the accurate information by calling getEnvironmentDetails and if this is possible would this be faster than having to wait for everything to complete

Two points:

Hence in such cases, its possible the user is looking for a virtual env and we display a conda environment and when they attempt to run it, then things fall over completely (because running conda environments require activation, and now execution fails and they get a lot of errors)

Populating the list is different than selecting an interpreter. When user attempts to select an interpreter, that is when getEnvironmentDetails can be called with full details. So before running it we know it's conda, and it won't fall over. My point is for purposes of displaying in the list, partial information can be helpful and full env details can only fetched for the selected kernel.

I say wrong, because we could end up displaying an environment as a virtual environment, when in fact its a conda environment or the like,

Secondly, the partial information displayed won't be wrong, the information only gets more detailed with time. For eg. a conda environment is not a virtual environment, so it'll never be classified as that. Pipenv environments are virtual environments under the hood, so it can be displayed as such until we figure out the better type for the env is pipenv.

Let me know your thoughts, before we move on to how to call the API.

Populating the list is different than selecting an interpreter. When user attempts to select an interpreter, that is when getEnvironmentDetails can be called with full details. So before running it we know it's conda, and it won't fall over. My point is for purposes of displaying in the list, partial information can be helpful and full env details can only fetched for the selected kernel.

I think we're talking about two different things.
Lets leave Python Interpreter selection out of this discussion. I'm referring to the kernel picker.

partial information can be helpful and full env details can only fetched for the selected kernel.

I'm referring to the Jupyter extension UI, not Python, I don't think you know how that works as this is not how the Jupyter UI works.

displayed won't be wrong, the information
Pipenv environments are virtual environments under the hood, so it can be displayed as such until we figure out the better type for the env is pipenv.so it can be displayed as such until we

In a users views, this information is incorrect hence my point. Yes we can argue about technical details, but as an end user, I'm looking for a Pipenv, not a Virtual Env, hence (Jupyter Extension) cannot necessarily classify these as virtual envs.
I.e. we cannot argue such technical details to an end user via a simple UI such as a quick pick.
I think have enough information at this stage, will check the API and get back to you.

I think we're talking about two different things.
Lets leave Python Interpreter selection out of this discussion. I'm referring to the kernel picker.

The following running scenario you mentioned comes after selection (picking the kernel):
"and we display a conda environment and when they attempt to run it, then things fall over completely (because running conda environments require activation, and now execution fails and they get a lot of errors)"
I was referring to that saying that won't be a problem.

I think have enough information at this stage, will check the API and get back to you.

Sure, check https://github.com/microsoft/vscode/issues/158246 for latest updates.

I was referring to that saying that won't be a problem.

Assume user have a pip env and virtual env, now they select the virtual env assuming its the virtual env they are expecting.
However the virtual env is infact a pipenv (as you mentioend pipenvs can be virtual envs).
Now user selects this and runs the cell.
The packages they installed like ipykernel, numpy, sklearn do not exist in there, and as a result things fall over and they get a lot of errors.
Based on what you said earlier this is possible.

Any packages we install into it are considering it's Pipenv, and any packages users installed into it outside of VSCode are considering it's Pipenv, so I don't see why packages won't be found. But okay, maybe I still misunderstand so please go ahead.

so I don't see why packages won't be found. B

Because as i mentioned user has two environmetns, pipenv and virtual env. hence packages in virtualenv will not be in pipenv.

@karrtikr
Scenario

User has two python environments A and B
How many times can the onDidEnvironmentsChanged get triggered?

Is it possible for this to get triggered twice, once for A and once for B and then again for A and B with type = "update".
It is my understanding that this is possible, if yes that's fine, as the even arg type clearly indicates the type of change.

Assume the discovery runs for 5 minutes (hypothetical, so we can expand the timeline and discuss what happens in the interim)

Assume we get the first event type="add" for envirnment A
Now, the Jupyter extension calls the API method

getEnvironmentDetails("A", useCache: false

Would we get the information after the full discovery?
I.e. is it possibel for us to get the details saying env type = FOO, and after the full discovery runs, then env type for A changes from FOO to BAR
In other words after this method returns, is it possible for the event onDidEnvironmentsChanged to get fired once again for the same environment A (because the env discovery is still in progress)

It is my understanding that this is possible, if yes that's fine, as the even arg type clearly indicates the type of change.

Yes that's possible. The add event should only be triggered once, update type can be triggered multiple times.

Would we get the information after the full discovery?

Are you asking if the information which is returned will be the same as the stable information after full discovery? Yes. However it won't wait for discovery to finish, so env discovery can be still in progress after this method returns.

In other words after this method returns, is it possible for the event onDidEnvironmentsChanged to get fired once again for the same environment A (because the env discovery is still in progress)

Yes, update type events can still get fired while discovery is going on. Consider resolving as separate from discovery.

thanks, curious then what wrong with the jupyter extension calling the

If kernel picker cannot work with partial details, there's nothing wrong it. getEnvironmentDetails returns the full details which is exactly what is needed. However it blocks running the interpreter to get details, so it's slower.
If it was possible for picker to display partial version information etc. and later update it, API offers the flexibility to display the info earlier so it can be selected earlier. We can potentially make it so that kind never changes.
I'm not sure on what is the case so I cannot advise.

We can potentially make it so that kind never changes.

not sure what your mean by this?
are you saying that if i call getEnvironmentDetails once then env type could be Foo and then call it again then it could be Bar.
from what i can tell them only way to get the env type is via the above api method.

are you saying that if i call getEnvironmentDetails once then env type could be Foo and then call it again then it could be Bar.

If called with useCache: false, it returns the final env type and the type never changes.
If called with useCache: true, it returns partial info, it may return a env type that can change later. The Venv to Pipenv case we talked about earlier. If Jupyter is interested in this option, I can potentially look into improving this scenario, so that env type never changes. Let me know.

Summary of discussions
Discussion:

At a minimum Trigger event with stable info for

name
type
id

Id will be added and that is unique

Proposals:

onDidChangeEnvironment.xxxx: Event;
type: add, remove, update
No more clear-all event
Two versions of getEnvironmentDetails, sync and async

getEnvironmentDetails(id:string): Promise<....>
getEnvironmentDetailsSync(id:string): {id:string; name:string; type: EnvType[];} & Record<string,string>

Need sync version of get environment from cache
This is coming soon

getEnvirons...: Id[]

Might use progress indicator
Change ProgressNotificationEvent

Remove allPathsDiscovered

Change getRefreshPromise to getRefreshPromise(): Promise<void> | undefined;
Remove args
Change refreshEnvironments to remove the argument.
refreshEnvironments()

Closing this as completed, the new API has been completely adopted.

Can we consider https://github.com/microsoft/vscode-python/issues/19989 as unblocked from Jupyter's end, if there's no feedback/concerns?

Can we leave the Python issue opeen at least for one iteration, in case we run into any issues, this was we have a chance to test the API in production.
In other words, I think we should consider leaving it open untill the API is used in production environment (by Jupyter) before considering it to be stable enough.
Note: That doesn't mean that there are any issues, but would prefer to leave the Python issue open for now.

Makes sense, not a problem.

authors: DonJayamanne IanMatthewHuff karrtikr rchiodo


text:
No more css and themes on the web views

These classes around CSS and Themes are not going to work on the web side, and we've confirmed over the chat that these are no longer needed. Please, let me know if I got that wrong.
How does this look?

Codecov Report

Merging #10119 (357ca50) into main (2081642) will increase coverage by 0%.
The diff coverage is n/a.

@@          Coverage Diff          @@
##           main   #10119   +/-   ##
=====================================
  Coverage    52%      52%
=====================================
  Files       203      203
  Lines      9243     9243
  Branches   1492     1492
=====================================
+ Hits       4859     4866    +7
+ Misses     3998     3992    -6
+ Partials    386      385    -1

Impacted Files
Coverage Δ

src/platform/common/platform/fileSystem.ts
50% <0%> (+5%)
:arrow_up:

src/platform/logging/consoleLogger.ts
50% <0%> (+11%)
:arrow_up:

src/platform/logging/outputChannelLogger.ts
50% <0%> (+11%)
:arrow_up:

I think we still need to know on the UI side whether its light or dark theme, as that controls the icons in webviews. Hence we cannot sending the value isDark to the UI.

I thought 'isDark' requires reading the theme json though? Maybe we can determine it some other way.

I thought 'isDark' requires reading the theme json though?

Nope

Maybe we can determine it some other way.

Yes,
we can use the activeColorTheme property in vscode.window

@DonJayamanne thank you so much!! Your feedback helps me a lot 🙏

authors: DonJayamanne codecov-commenter rchiodo sadasant


text:
Ignore load err that stops Python Ext from loading

For #5145

Codecov Report

Merging #5146 (9293fb0) into main (3d558a3) will increase coverage by 1%.
The diff coverage is 66%.

@@          Coverage Diff           @@
##            main   #5146    +/-   ##
======================================
+ Coverage     71%     72%    +1%
======================================
  Files        402     402
  Lines      26392   26393     +1
  Branches    3798    3798
======================================
+ Hits       18741   19098   +357
+ Misses      6091    5707   -384
- Partials    1560    1588    +28

Impacted Files
Coverage Δ

src/client/extension.ts
63% <66%> (-2%)
:arrow_down:

src/client/datascience/kernelSocketWrapper.ts
45% <0%> (-30%)
:arrow_down:

src/client/common/application/encryptedStorage.ts
36% <0%> (-22%)
:arrow_down:

src/client/common/configuration/service.ts
67% <0%> (-15%)
:arrow_down:

...ascience/raw-kernel/rawNotebookSupportedService.ts
75% <0%> (-12%)
:arrow_down:

src/client/datascience/liveshare/liveshare.ts
66% <0%> (-10%)
:arrow_down:

src/client/datascience/notebook/introStartPage.ts
91% <0%> (-9%)
:arrow_down:

.../client/datascience/notebook/kernelWithMetadata.ts
78% <0%> (-8%)
:arrow_down:

src/client/datascience/jupyter/serverUriStorage.ts
82% <0%> (-6%)
:arrow_down:

src/client/datascience/datascience.ts
88% <0%> (-3%)
:arrow_down:

... and 73 more

authors: DonJayamanne codecov-io


text:
Update test plan

For https://github.com/microsoft/vscode-jupyter/issues/4836

[ ] Pull request represents a single change (i.e. not fixing disparate/unrelated things in a single PR).
[ ] Title summarizes what is changing.
[ ] Has a news entry file (remember to thank yourself!).
[ ] Appropriate comments and documentation strings in the code.
[ ] Has sufficient logging.
[ ] Has telemetry for enhancements.
[ ] Unit tests & system/integration tests are added/updated.
[ ] Test plan is updated as appropriate.
[ ] package-lock.json has been regenerated by running npm install (if dependencies have changed).

Codecov Report

Merging #5780 (3a2ad27) into main (a549705) will increase coverage by 6%.
The diff coverage is n/a.

@@           Coverage Diff           @@
##            main   #5780     +/-   ##
=======================================
+ Coverage     65%     72%     +6%
=======================================
  Files        352     403     +51
  Lines      24164   26916   +2752
  Branches    3637    3926    +289
=======================================
+ Hits       15844   19442   +3598
+ Misses      6927    5839   -1088
- Partials    1393    1635    +242

Impacted Files
Coverage Δ

...t/datascience/jupyter/kernels/jupyterKernelSpec.ts
57% <0%> (-40%)
:arrow_down:

src/client/common/errors/errorUtils.ts
34% <0%> (-13%)
:arrow_down:

src/client/datascience/kernel-launcher/types.ts
48% <0%> (-8%)
:arrow_down:

src/client/common/errors/index.ts
69% <0%> (-4%)
:arrow_down:

src/client/datascience/jupyter/kernels/helpers.ts
71% <0%> (-2%)
:arrow_down:

...tascience/jupyter/liveshare/hostJupyterNotebook.ts
44% <0%> (-2%)
:arrow_down:

src/client/datascience/baseJupyterSession.ts
70% <0%> (-1%)
:arrow_down:

src/client/datascience/types.ts
100% <0%> (ø)

...active-common/intellisense/intellisenseProvider.ts
74% <0%> (ø)

src/client/datascience/notebook/remoteSwitcher.ts
91% <0%> (ø)

... and 170 more

authors: codecov-commenter joyceerhl


text:
Comments panel appears when expanding tree node

👋

Extension version: v0.57.2022122310 (pre-release)
VSCode Version: Version: 1.74.3 (Universal)
OS: 12.6.1 (21G217)

Steps to Reproduce:

Open GitHub view
Expand an item from the pull requests view
:bug: comments panel appears even though it was hidden previous

https://user-images.githubusercontent.com/35271042/211974694-468d01a5-4280-4093-b835-3616085bcb31.mp4

👋
It looks like the Comments view is just restoring, as expected:

You have the vscode-symbols workspace open
There are comments in the vscode-symbols workspace so the Comments view exists.
You close the workspace.
Next time you open the vscode-symbols workspace there are no comments in the workspace so the Comments view is hidden.
You expand the PR tree node and now comments exist in the workspace (via a commenting range provider).
The Comments view is un-hidden because comments now exist.

I think the best fix is for the extension to register in a way that causes the comments view to always be un-hidden.

repo: microsoft/vscode-pull-request-github


text:
Python interpreters on Windows are reported as 'Unknown'

On master, commit 17684835574523246bc68521d91e7061d07c934a, after having added the readdir fix for #10850 manually:
Interpreters installed from the Windows Store are of type Unknown because they are found through the KnownPathService locator, and not WindowsRegistryService:

And interpreters installed from python.org are also of type Unknown because they are found using the WindowsRegistryService locator:

The spike is to find more places where we use UNKNOWN

authors: karthiknadig kimadeline

repo: microsoft/vscode-python