Skip to content

Cannot switch to base conda environment in interactive window after latest updates #25814

Closed
microsoft/vscode-python-environments
#1412

Description

@david-cortes

Environment data

  • VS Code version: 1.109.5
  • Jupyter Extension version (available under the Extensions sidebar): 2025.9.1
  • Python Extension version (available under the Extensions sidebar): 2026.2.0
  • OS (Windows | Mac | Linux distro) and version: Debian Linux
  • Python and/or Anaconda version: conda 24.11.3 / mamba 1.5.9
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): conda
  • Jupyter server running: Local

Steps to reproduce:

  1. Create a conda setup with many environments.
  2. Launch a new interactive jupyter window from this extension.
  3. Change the python kernel to the base conda environment.

Video:
Image

Expected behaviour

Should switch to the base environment.

Actual behaviour

Switches to the last environment in the list, regardless of what's the current environment.

It does not affect saved interactive windows that were created before the latest updates to the python extension and vscode from a few weeks ago or so - not sure which one is at fault though.

Logs

Does not produce any log in the jupyter extension logs.

Output for Jupyter in the Output panel (View→Output, change the drop-down the upper-right of the Output panel to Jupyter)

XXX

Activity

  1. added
    bugIssue identified by VS Code Team member as probable bug
    on Feb 22, 2026
  2. amunger commented on Feb 23, 2026

    @amunger

    is this only in the interactive window? are you able to select that kernel for a notebook in VS code?

  3. david-cortes commented on Feb 23, 2026

    @david-cortes
    Author

    is this only in the interactive window? are you able to select that kernel for a notebook in VS code?

    Also affects notebooks.

  4. Jiefei-Wang commented on Feb 24, 2026

    @Jiefei-Wang

    Exactly same issue here. It only affect the base environment, the other environments are fine. I'm on Windows.

  5. DonJayamanne commented on Feb 24, 2026

    @DonJayamanne

    This looks like something related to the new Python extensoin.
    Jiefei Wang (@Jiefei-Wang) david-cortes If you have the Python Environments extension, please can you try to uninstall that and see if it makes a difference.
    Optionally can you try to revert your Python extension to last months or month before and see if that makes a diference.
    We didn't make any changes in Jupyter extension, hence this must either be caused by Python extension updates or this is an issue that has always existed or other.

  6. david-cortes commented on Feb 25, 2026

    @david-cortes
    Author

    Don Jayamanne (@DonJayamanne) If downgrading the Python extension, the base conda environment doesn't even show up in the menu anymore right after uninstalling:
    Image

    After restarting vscode, it shows up again, but still suffers from the same problem.

    Uninstalling the python environments extension solves the problem though.

  7. nahanoo commented on Feb 26, 2026

    @nahanoo

    I think I have a related bug.
    If I Change Python: Select Interpreter to my conda interpreter, it doesn't actually change the interpreter.
    This is a bit annoying because my packages are installed in the conda environment and therefore the linting doesn't work anymore. I think it started when migrating one of the python extensions because one was put to the graveyard a couple of days ago.
    Next to the selected interpreter that I can't change, which is my system installation, there is a Global label. Maybe this was implemented a bit too globally? 😜
    Best,

  8. nickeubank commented on Mar 6, 2026

    @nickeubank

    I'm having the same issue in notebooks and interpreter, though it appears to be intermittant — sometimes it works, sometimes when I select base it actually chooses whatever the closest environment is alphabetically.

    I see there's still a info-needed tag on this — what more info would be helpful?

  9. 3 remaining items

  10. added
    area-environmentsFeatures relating to handling interpreter environments
    confirmation pendingThe issue needs to be confirmed through a maintainer reproducing the bug.
    and removed
    triage-neededNeeds assignment to the proper sub-team
    on Mar 13, 2026
  11. nahanoo commented on Mar 24, 2026

    @nahanoo

    Any news on this or proposed fixes?

  12. jpmaterial commented on Mar 26, 2026

    @jpmaterial

    I this issue too, though switching to old version of the Python extension did not help

    1. The interpreter widget would stubbornly display always the same env, even when choosing a different one.
    2. That env was used when running a file
    3. Curiously enough, syntax highlighting (missing imports) was based on the actually chosen env (which was also reported in Output/Python)
    4. This only affected one workspace

    What helped was to delete the workspace's folder under ~/AppData/Roaming/Code/User/workspaceStorage

  13. StellaHuang95 commented on Mar 30, 2026

    @StellaHuang95

    jpmaterial, Eric Ulrich (@nahanoo), thanks for the additional details, this is consistent with the root cause we found. A fix has been submitted in PR #1412

  14. nahanoo commented on Apr 2, 2026

    @nahanoo

    Hi,
    Thanks for your work and it was interesting to read about the source of the bug in your PR.
    This PR should be already integrated in code-insiders right?
    Because I wanted to test the fix and I installed 1.115.0-insider 54b695e02e47a37ded9ca68a32bb0d00d4560030 and the bug remained.
    Happy to assist more.
    Best,

    UPDATE
    I switched to the pre-release version of the python environments extension (1.27.10911017) and the bug persists.
    Then I saw that the PR 1412 is not yet in 1.27 is that correct?

  15. StellaHuang95 commented on Apr 2, 2026

    @StellaHuang95

    Hi Eric Ulrich (@nahanoo), yes this fix was made in the Python Environments extension. Could you try updating to the latest pre-release version (1.27.10921013) and see if the issue persists?

    If it does, what you're experiencing might be a different issue from the one that was fixed. The linked PR specifically fixed a scenario where the base conda environment gets silently replaced by a named conda environment after reloading VS Code. For example:

    1. You have a conda installation (e.g. /miniconda3/) with the base env (e.g. Python 3.10) plus named envs like torch (e.g. Python 3.12) or data_science (e.g. Python 3.11)
    2. You select the base conda environment as the active interpreter
    3. You reload or restart VS Code
    4. Instead of base, a different named env (whichever has the highest Python version) appears as active

    If your scenario is different from the above, would you mind opening a new issue at https://github.com/microsoft/vscode-python-environments with concrete repro steps? That way we can take a closer look. Thanks!

  16. nahanoo commented on Apr 8, 2026

    @nahanoo

    Thanks Stella Huang (@StellaHuang95)
    I opened a new issue under microsoft/vscode-python-environments#1446.
    See you over there hopefully:)

  17. Taardisaa commented on Apr 11, 2026

    @Taardisaa

    Hi,
    I witnessed the same issue.
    But then I uninstalled the "Python Environments" extension (version 1.26.0), and it can switch to conda base env successfully.
    Maybe there's some bug in this "Python Environments" extension.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area-environmentsFeatures relating to handling interpreter environmentsbugIssue identified by VS Code Team member as probable bugconfirmation pendingThe issue needs to be confirmed through a maintainer reproducing the bug.info-neededIssue requires more information from poster

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions