microsoft / vscode-python

Python extension for Visual Studio Code
https://aka.ms/pvsc-marketplace
MIT License
4.29k stars 1.18k forks source link

Anaconda environments listed as 'base' #23954

Open Flottrant opened 1 month ago

Flottrant commented 1 month ago

Type: Bug

Behaviour

Most of the conda environments in the automatic environment detection are listed as 'base' even though they show the correct path to the environment. The VSCode terminal then only activates the actual conda base environment in the console. Environments work correctly in independent terminals.

Steps to reproduce:

  1. Open VSCode
  2. Open command palette
  3. Run the command Python: Select Interpreter

Diagnostic data

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

``` XXX ```

Extension version: 2024.12.3 VS Code version: Code 1.92.2 (fee1edb8d6d72a0ddff41e5f71a671c23ed924b9, 2024-08-14T17:29:30.058Z) OS version: Windows_NT x64 10.0.22631 Modes:

User Settings

``` languageServer: "Pylance" testing • unittestArgs: "" • unittestEnabled: true ```

Installed Extensions |Extension Name|Extension Id|Version| |---|---|---| |autoDocstring - Python Docstring Generator|njpwerner.autodocstring|0.6.1| |Black Formatter|ms-python.black-formatter|2024.3.12071014| |Dev Containers|ms-vscode-remote.remote-containers|0.381.0| |Docker|ms-azuretools.vscode-docker|1.29.2| |Even Better TOML|tamasfe.even-better-toml|0.19.2| |Excel Viewer|GrapeCity.gc-excelviewer|4.2.60| |Git History|donjayamanne.githistory|0.6.20| |Git Project Manager|felipecaputo.git-project-manager|1.8.2| |GitHub Copilot|GitHub.copilot|1.223.0| |GitHub Copilot Chat|GitHub.copilot-chat|0.18.2| |GitHub Theme|GitHub.github-vscode-theme|6.3.4| |GitLens — Git supercharged|eamodio.gitlens|15.3.0| |H5Web|h5web.vscode-h5web|0.1.6| |JavaScript Debugger|ms-vscode.js-debug|1.92.0| |JavaScript Debugger Companion Extension|ms-vscode.js-debug-companion|1.1.3| |Jupyter|ms-toolsai.jupyter|2024.7.0| |Jupyter Cell Tags|ms-toolsai.vscode-jupyter-cell-tags|0.1.9| |Jupyter Keymap|ms-toolsai.jupyter-keymap|1.1.2| |Jupyter Notebook Renderers|ms-toolsai.jupyter-renderers|1.0.19| |Jupyter Slide Show|ms-toolsai.vscode-jupyter-slideshow|0.1.6| |markdownlint|DavidAnson.vscode-markdownlint|0.55.0| |Pylance|ms-python.vscode-pylance|2024.8.101| |Python|ms-python.python|2024.12.3| |Python Debugger|ms-python.debugpy|2024.11.2024081401| |Python Environment Manager|donjayamanne.python-environment-manager|1.2.4| |Remote - SSH|ms-vscode-remote.remote-ssh|0.113.1| |Remote - SSH: Editing Configuration Files|ms-vscode-remote.remote-ssh-edit|0.86.0| |Remote - Tunnels|ms-vscode.remote-server|1.5.2| |Remote Development|ms-vscode-remote.vscode-remote-extensionpack|0.25.0| |Remote Explorer|ms-vscode.remote-explorer|0.4.3| |Ruff|charliermarsh.ruff|2024.40.0| |Table Visualizer for JavaScript Profiles|ms-vscode.vscode-js-profile-table|1.0.9| |vscode-pdf|tomoki1207.pdf|1.2.2| |WSL|ms-vscode-remote.remote-wsl|0.88.2|
System Info |Item|Value| |---|---| |CPUs|12th Gen Intel(R) Core(TM) i7-12700H (20 x 2688)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off| |Load (avg)|undefined| |Memory (System)|15.69GB (4.05GB free)| |Process Argv|--crash-reporter-id c259a226-0570-43d2-8380-de3aa8b15c8e| |Screen Reader|no| |VM|0%|
A/B Experiments ``` vsliv368cf:30146710 vspor879:30202332 vspor708:30202333 vspor363:30204092 vscod805:30301674 binariesv615:30325510 vsaa593:30376534 py29gd2263:31024239 c4g48928:30535728 azure-dev_surveyone:30548225 962ge761:30959799 pythongtdpath:30769146 welcomedialog:30910333 pythonnoceb:30805159 asynctok:30898717 pythonregdiag2:30936856 pythonmypyd1:30879173 h48ei257:31000450 pythontbext0:30879054 accentitlementst:30995554 dsvsc016:30899300 dsvsc017:30899301 dsvsc018:30899302 cppperfnew:31000557 dsvsc020:30976470 pythonait:31006305 dsvsc021:30996838 bdiig495:31013172 pythoncenvpt:31062603 a69g1124:31058053 dvdeprecation:31068756 dwnewjupytercf:31046870 2f103344:31071589 impr_priority:31102340 refactort:31108082 pythonrstrctxt:31112756 wkspc-onlycs-c:31111717 nativeloc1:31118318 wkspc-ranged-c:31118571 pme_test_t:31118333 ```
anthonykim1 commented 1 month ago

Hello @Flottrant Thank you for filing this issue. Are you able to add:

 "python.experiments.optOutFrom": ["pythonTerminalEnvVarActivation"],

in your settings.json and see if you can repro the same problem?

Flottrant commented 1 month ago

Hello @anthonykim1, the issue seems to have disapeared completely after switching to version 2024.10.0 and back. However, the same was not true for any version newer than 2024.10.0.

anthonykim1 commented 1 month ago

@Flottrant Hello, when you search your setting and search 'native locator', is that set to native or js?

Flottrant commented 3 weeks ago

It is set to js

Flottrant commented 3 weeks ago

Setting it to native reproduced the issue. This was with the "python.experiments.optOutFrom": ["pythonTerminalEnvVarActivation"] line added to the settings.json.