microsoft / vscode-jupyter

VS Code Jupyter extension
https://marketplace.visualstudio.com/items?itemName=ms-toolsai.jupyter
MIT License
1.3k stars 294 forks source link

Jupyter on VSCode takes >10 seconds to activate a kernel #16144

Closed marceloprates closed 2 weeks ago

marceloprates commented 1 month ago

Does this issue occur when all extensions are disabled?: Yes

Steps to Reproduce:

  1. Install the jupyter extension
  2. Create a blank conda environment with conda env -n test python==3.10
  3. Install ipykernel with conda install ipykernel
  4. Create a jupyter notebook, select kernel "test" and run the first cell
wyatt-wong commented 1 month ago

I have similar issue but i didn't use conda. I only installed Jupyter extension.

Jupyter

marceloprates commented 4 weeks ago

I get this kind of problem when I try to restart a notebook on vscode, but when I run jupyter notebooks outside vscode there are no such issues.

19:00:35.575 [error] Failed to get activated conda env vars for ~/anaconda3/envs/main/bin/python in 60050ms 19:00:35.578 [error] Unable to determine site packages path for python ~/anaconda3/envs/main/bin/python (Conda)

marceloprates commented 4 weeks ago

9:30:22.336 [info] Starting Kernel (Python Path: ~/anaconda3/envs/main/bin/python, Conda, 3.10.15) for 'Untitled-1.ipynb' (disableUI=true) 19:31:23.503 [error] Failed to get activated conda env vars for ~/anaconda3/envs/main/bin/python in 61182ms 19:31:23.506 [error] Unable to determine site packages path for python ~/anaconda3/envs/main/bin/python (Conda) 19:31:23.538 [info] Process Execution: ~/anaconda3/envs/main/bin/python -m pip list 19:31:23.541 [error] Failed to get activated conda env vars for ~/anaconda3/envs/main/bin/python in 61187ms 19:31:23.542 [error] Unable to determine site packages path for python ~/anaconda3/envs/main/bin/python (Conda) 19:31:23.562 [info] Process Execution: ~/anaconda3/envs/main/bin/python -c "import ipykernel; print(ipykernel.version); print("5dc3a68c-e34e-4080-9c3e-2a532b2ccb4d"); print(ipykernel.file)" 19:31:23.606 [info] Process Execution: ~/anaconda3/envs/main/bin/python -m ipykernel_launcher --f=/home/~/.local/share/jupyter/runtime/kernel-v3278984fd0d116ba3daf746488b29f3c1e510165f.json

cwd: /home/~ 19:31:24.339 [info] Kernel successfully started

DonJayamanne commented 3 weeks ago

@wyatt-wong @marceloprates I'm sorry you are running into this issue.

19:31:23.503 [error] Failed to get activated conda env vars for ~/anaconda3/envs/main/bin/python in 61182ms

Looks like there's a failure to get the activated environment variables for the Conda environment. This seems to be an issue coming from the Python extension.

Please could you enable logging as follows:

vs-code-engineering[bot] commented 2 weeks ago

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!