Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List of kernels shows deleted non-existent conda environments #6164

Closed
elkir opened this issue Apr 12, 2021 · 11 comments
Closed

List of kernels shows deleted non-existent conda environments #6164

elkir opened this issue Apr 12, 2021 · 11 comments

Comments

@elkir
Copy link

elkir commented Apr 12, 2021

Issue Type: Bug

Old conda environments that have been deleted using
conda env remove --name <env_name>
are still showing up in the drop down menu of jupyter kernels.

They mention the old environment name as well as the location in the
anaconda/env/<env_name> folder despite the fact that the folder no longer exists.

When selected it throws out an error.

Extension version: 2020.12.414227025
VS Code version: Code 1.55.1 (08a217c4d27a02a5bcde898fd7981bda5b49391b, 2021-04-07T15:01:24.315Z)
OS version: Linux x64 5.8.0-48-generic snap

System Info
Item Value
CPUs Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz (8 x 3503)
GPU Status 2d_canvas: unavailable_software
gpu_compositing: disabled_software
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
opengl: disabled_off
protected_video_decode: disabled_off
rasterization: disabled_software
skia_renderer: enabled_on
video_decode: disabled_software
vulkan: disabled_off
webgl: unavailable_software
webgl2: unavailable_software
Load (avg) 2, 2, 2
Memory (System) 15.49GB (0.21GB free)
Process Argv --force-user-env --no-sandbox --unity-launch --no-sandbox --crash-reporter-id e0b4888e-7039-4296-a9e5-65e00d3fce86
Screen Reader no
VM 0%
DESKTOP_SESSION ubuntu
XDG_CURRENT_DESKTOP Unity
XDG_SESSION_DESKTOP ubuntu
XDG_SESSION_TYPE x11
A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
vstry914:30276682
pythonvsdeb440:30248342
pythonvsded773:30248341
vstes627:30244334
pythonvspyt875:30259475
pythontb:30283811
openwsldoc:30282072
vspre833cf:30267465
pythonptprofiler:30281270
vshan820:30276952
pythondataviewer:30285071
vscus158:30286553

@joyceerhl
Copy link
Contributor

@elkir thanks for the bug. Please could you update your installed copies of the Jupyter and Python extensions for VS Code? We have made several improvements to conda kernel handling in both, and those may resolve the scenario you are reporting. Thank you!

@elkir
Copy link
Author

elkir commented Apr 14, 2021

Jupyter v2021.5.745244803
Python v2021.3.680753044
(currently both the highest version available in standard VS Code)

The Python: Select interpreter works fine. It's only the Jupyter version that has the deleted ones.

@DonJayamanne
Copy link
Contributor

@elkir

  • Please could you replicate this issue at your end
  • Then copy the contents from your Jupyter output panel & paste here (u might have to upload a file)
  • Finally please let me know the names of the environment that have been deleted (so that i can find them in the logs)

Thanks

@DavidKutu DavidKutu self-assigned this May 5, 2021
@elkir
Copy link
Author

elkir commented May 14, 2021

Here is the file:
jupyter_output.txt

  1. I opened VS Code, with a jupyter notebook.
  2. Clicked on this kernel and environment, which exists:
    Python 3.8.6 64-bit ('phd_ph1-02_pypsa-eur_grid': conda)
    /opt/anaconda/anaconda3/envs/phd_ph1-02_pypsa-eur_grid/bin/python
  3. Clicked on this environment which doesn't exist:
    Python 3.8.6 64-bit ('phd_ph1-03_pypsa-eur_grid': conda)
    /opt/anaconda/anaconda3/envs/phd_ph1_03_pypsa-eur_grid/bin/python
  4. Terminated the loading of the environment which was stuck in the loading phase, through clicking on the popup in bottom left corner

@DavidKutu
Copy link

This works as expected if you reload twice after deleting the env (instead of just once). I'm looking into why

@DavidKutu DavidKutu transferred this issue from microsoft/vscode-jupyter Jun 6, 2021
@DavidKutu
Copy link

DavidKutu commented Jun 6, 2021

This is an issue with getInterpreters() in the python api.

Version: 1.57.0-insider (user setup)
Commit: fe1eafc80c07608de52a2f9c99fee103dea77f5e
Date: 2021-06-04T12:21:40.077Z
Electron: 12.0.9
Chrome: 89.0.4389.128
Node.js: 14.16.0
V8: 8.9.255.25-electron.0
OS: Windows_NT x64 10.0.19041

Python extension version: v2021.5.842923320

Steps to reproduce

  1. create conda env
  2. reload window
  3. (new env doesn't get found in the interpreter picker)
  4. reload again
  5. (now it gets found)

It also reproduces in reverse

  1. delete conda env
  2. reload window
  3. (deleted env still shows in the interpreter picker)
  4. reload again
  5. (now its gone)

@DonJayamanne
Copy link
Contributor

DonJayamanne commented Jun 7, 2021

Moving this back,

The Python: Select interpreter works fine. It's only the Jupyter version that has the deleted ones.

as mentioned above by the user its a problem in Jupyter (Python doesnt display the deleted items)
I've tested this at my end as well and can replicate this (reloading 3 times didn't fix it).
Hence moving back to Jupyter repo.

@DonJayamanne DonJayamanne transferred this issue from microsoft/vscode-python Jun 7, 2021
@DonJayamanne
Copy link
Contributor

@DavidKutu if you thinnk there's a Python extension issue as well, please create a new issue (this way we fix both bugs, the one in Python ext & Jupyter extension as well).

@IanMatthewHuff
Copy link
Member

Not validated. I still see this issue.

Conda env has been deleted. But it's seen in the controller picker (deleteEnv2):
image.png

It's not seen in the python interpreter list at this time.

Per David's comment it clears after another reload. I think we might be returning an initial cached interpreter list from the python extension and creating controllers based off of that. Not sure on the priority here, as it does clear after the reload.

@DonJayamanne
Copy link
Contributor

Conda env has been deleted. But it's seen in the controller picker (deleteEnv2):

We don't dispose controllers retrospectively (once it's been created).
And I think python returns the cached list the first time around.
I'm not keen on checking the time paths as that will show the whole thing down even more.
If anything I'd leave this around for more upvotes

@IanMatthewHuff
Copy link
Member

IanMatthewHuff commented Jun 15, 2021

@DonJayamanne my vote is that it's also not a pressing issue. I'd also rather not check paths of interpreters (not ownership that we would want) from the python extension. I know that we don't remove controllers, but it is seen the first reload after deleting, probably the cache as we both mentioned.

@rchiodo rchiodo closed this as completed Jun 17, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants