Duplicate environments after fixing python
See original GitHub issueIssue 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:
- On Windows, create a new conda environment called snowflakes
- Rename the python file within that environment to make the extension not be able to find the interpreter
- Reload the window and reactivate the extension. Confirm that a warning icon shows up next to the snowflakes environment
- Rename the python file back to python.exe
- Reload the window and reactivate the extension. Two snowflake environments show up in the interpreter picker
Screenshots
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 (0e3304bca9e862eddc7e437e2bab8a4a4a4f33c9, 2022-06-29T05:20:28.364Z) OS version: Windows_NT x64 10.0.19043 Restricted Mode: No
System Info
Item | Value |
---|---|
CPUs | Intel® Core™ 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% |
Issue Analytics
- State:
- Created a year ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
How to clone Python working environment on another machine?
First of all this is a Python/Anaconda question and should probably be asked in a ... Then use virtual environment tools to duplicate...
Read more >How to CLONE LOCAL python environment (+ALL packages ...
I want to CLONE Python and ALL installed packages into virtual environment using virtualenv. there are couple of answers here on ...
Read more >How To: Clone a Python environment with the ... - Esri Support
As a workaround, Python environments can be cloned using the Python Command Prompt. Use the instructions provided in this article. Procedure.
Read more >Manage Python environments and interpreters - Visual Studio ...
In the Python environment window, select the environment, and then select the Configure tab. · After making changes, select the Apply command.
Read more >Clone an environment—ArcGIS Pro | Documentation
What is the ArcGIS API for Python? ... To clone an environment, complete the following steps: ... Click the Clone environment button Duplicate...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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.
FYI we now have a button to support hard refreshing, which clears the cache before refreshing: https://github.com/microsoft/vscode-python/pull/19628. It can be used here.