Skip to content

Duplicate environments after fixing python #19384

Closed

Description

Issue Type: Bug

Behaviour

Expected vs. Actual

Expected: the snowflakes environment doesn't show up twice
Actual: the snowflakes environment shows up twice

Steps to reproduce:

  1. On Windows, create a new conda environment called snowflakes
  2. Rename the python file within that environment to make the extension not be able to find the interpreter
  3. Reload the window and reactivate the extension. Confirm that a warning icon shows up next to the snowflakes environment
  4. Rename the python file back to python.exe
  5. Reload the window and reactivate the extension. Two snowflake environments show up in the interpreter picker

Screenshots

Screenshot showing there are two options named snowflakes in the interpreter picker instead of one

Diagnostic data

  • Python version (& distribution if applicable, e.g. Anaconda): 3.10.4
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Conda
  • Value of the python.languageServer setting: Pylance
Output for Python in the Output panel (View→Output, change the drop-down the upper-right of the Output panel to Python)

L’expérience «All» est active
LSP Notebooks experiment is disabled -- not in treatment group
> ~\Miniconda3 info --json
> conda info --json
> ~\AppData\Local\Programs\Python\Python39\python.exe ~\.vscode-insiders\extensions\ms-python.python-2022.9.11791004\pythonFiles\get_output_via_markers.py ~\.vscode-insiders\extensions\ms-python.python-2022.9.11791004\pythonFiles\interpreterInfo.py
> C:\msys64\mingw64\bin\python.exe ~\.vscode-insiders\extensions\ms-python.python-2022.9.11791004\pythonFiles\get_output_via_markers.py ~\.vscode-insiders\extensions\ms-python.python-2022.9.11791004\pythonFiles\interpreterInfo.py
> ~\.pyenv\pyenv-win\versions\2.7.16\python.exe ~\.vscode-insiders\extensions\ms-python.python-2022.9.11791004\pythonFiles\get_output_via_markers.py ~\.vscode-insiders\extensions\ms-python.python-2022.9.11791004\pythonFiles\interpreterInfo.py
> ~\.pyenv\pyenv-win\versions\3.8.10\python.exe ~\.vscode-insiders\extensions\ms-python.python-2022.9.11791004\pythonFiles\get_output_via_markers.py ~\.vscode-insiders\extensions\ms-python.python-2022.9.11791004\pythonFiles\interpreterInfo.py
> ~\.pyenv\pyenv-win\versions\3.9.4\python.exe ~\.vscode-insiders\extensions\ms-python.python-2022.9.11791004\pythonFiles\get_output_via_markers.py ~\.vscode-insiders\extensions\ms-python.python-2022.9.11791004\pythonFiles\interpreterInfo.py
> .\.venv1\Scripts\python.exe ~\.vscode-insiders\extensions\ms-python.python-2022.9.11791004\pythonFiles\get_output_via_markers.py ~\.vscode-insiders\extensions\ms-python.python-2022.9.11791004\pythonFiles\interpreterInfo.py
> ~\AppData\Local\Microsoft\WindowsApps\python3.7.exe ~\.vscode-insiders\extensions\ms-python.python-2022.9.11791004\pythonFiles\get_output_via_markers.py ~\.vscode-insiders\extensions\ms-python.python-2022.9.11791004\pythonFiles\interpreterInfo.py
> ~\Miniconda3\Scripts\conda.exe info --json
> ~\Miniconda3\python.exe ~\.vscode-insiders\extensions\ms-python.python-2022.9.11791004\pythonFiles\get_output_via_markers.py ~\.vscode-insiders\extensions\ms-python.python-2022.9.11791004\pythonFiles\interpreterInfo.py
> ~\AppData\Local\Programs\PythonCodingPack\python.exe ~\.vscode-insiders\extensions\ms-python.python-2022.9.11791004\pythonFiles\get_output_via_markers.py ~\.vscode-insiders\extensions\ms-python.python-2022.9.11791004\pythonFiles\interpreterInfo.py
> ~\AppData\Local\Programs\Python\Python38\python.exe ~\.vscode-insiders\extensions\ms-python.python-2022.9.11791004\pythonFiles\get_output_via_markers.py ~\.vscode-insiders\extensions\ms-python.python-2022.9.11791004\pythonFiles\interpreterInfo.py
> ~\Miniconda3\condabin\conda.bat info --json
> ~\Miniconda3\envs\snowflakes\python.exe ~\.vscode-insiders\extensions\ms-python.python-2022.9.11791004\pythonFiles\get_output_via_markers.py ~\.vscode-insiders\extensions\ms-python.python-2022.9.11791004\pythonFiles\interpreterInfo.py
Chemin de l’interpréteur Python : ~\Miniconda3\envs\snowflakes\python.exe
> ~\Miniconda3\Scripts\conda.exe run -n snowflakes --no-capture-output python ~\.vscode-insiders\extensions\ms-python.python-2022.9.11791004\pythonFiles\get_output_via_markers.py ~/.vscode-insiders/extensions/ms-python.python-2022.9.11791004/pythonFiles/printEnvVariables.py
Démarrage du serveur de langage Pylance

User Settings


condaPath: "<placeholder>"

languageServer: "Pylance"

formatting
• provider: "black"

experiments
• optInto: ["All"]

Extension version: 2022.9.11791004
VS Code version: Code - Insiders 1.69.0-insider (0e3304b, 2022-06-29T05:20:28.364Z)
OS version: Windows_NT x64 10.0.19043
Restricted Mode: No

System Info
Item Value
CPUs Intel(R) Core(TM) i7-1065G7 CPU @ 1.30GHz (8 x 1498)
GPU Status 2d_canvas: unavailable_software
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: disabled_software
multiple_raster_threads: enabled_on
opengl: disabled_off
rasterization: disabled_software
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: disabled_software
video_encode: disabled_software
vulkan: disabled_off
webgl: unavailable_software
webgl2: unavailable_software
Load (avg) undefined
Memory (System) 31.59GB (16.04GB free)
Process Argv --log trace --crash-reporter-id 504c9256-58c2-451f-8cc0-983584dae98d
Screen Reader no
VM 0%

Activity

  1. added
    triage-needed
    on Jun 29, 2022
  2. added
    bug
    area-environments
    on Jun 29, 2022
  3. karthiknadig commented on Jun 29, 2022

    @karthiknadig
    Member

    This might be due to caching; can you try clicking the refresh button on the upper right corner of the quick pick.

  4. rzhao271 commented on Jun 29, 2022

    @rzhao271
    Author

    There are still two entries after refreshing the quick pick

  5. added
    investigating
    on Jun 29, 2022
  6. removed
    investigating
    on Jul 7, 2022
  7. karrtikr commented on Jul 29, 2022

    @karrtikr

    I'm able to reproduce the issue, thanks. Clearing the list using Python: Clear Internal extension cache should help.

    This looks like an unnatural occurrence of an already rare scenario (conda environments without python) that is only created by poking behind the scenes. Closing this as attempting to fix it complicates the code quite a bit, and the use-case doesn't warrant it. If more people run into it we'll happy to take a look again.

  8. karrtikr commented on Jul 29, 2022

    @karrtikr

    Also, the refresh icon does not clear cache by default, so that does not help. Would be great if we eventually had something like this for a hard refresh option:

    image

  9. karrtikr commented on Aug 4, 2022

    @karrtikr

    FYI we now have a button to support hard refreshing, which clears the cache before refreshing: #19628. It can be used here.

    hardrefresh2

  10. locked as resolved and limited conversation to collaborators on Sep 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area-environmentsbugtriage-needed

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions