Skip to content

【BUG】Python Debugger environment activation failed ! #753

Closed

Description

@juntaosun

vscode python environment does not work~

For a more detailed description, see:
microsoft/vscode#256399 (comment)

~

(1)Disable Python Debugger plugin (works in python environment):
Image

(2)Enable Python Debugger plugin (python does not work):
Image

( Disable or enable the plugin and restart Vscode to test )
This plugin seems to block or affect, destroy the activation of the conda python environment in vscode~
The above picture is enough to prove the problem! Please check BUG ~ Thanks ~


安装
标识符
ms-python.debugpy
版本
2025.10.0
上次更新时间
2025-07-13, 00:40:14
大小
33.46 MB
市场
已发布
2023-06-15, 02:20:56
上次发布时间
2025-07-11, 06:37:39

Activity

  1. theholy7 commented on Jul 17, 2025

    @theholy7

    I'm getting this same issue on my VSCode on MacOS. Python virtual environment seems to be active but when running which python it returns python not found.

    Doing the same as this user yields results, and the environment works as expected again.

  2. juntaosun commented on Jul 17, 2025

    @juntaosun
    Author

    By observing the PATH path of this python-debugger plugin, it is obvious that it mistakenly overwrites the original Conda PATH, and the appended path is obviously wrong.

    Image
    ms-python.python:     
    PATH=C:\Users\sunny\miniconda3\envs\py310;    
    C:\Users\sunny\miniconda3\envs\py310\Library\mingw-w64\bin;    
    C:\Users\sunny\miniconda3\envs\py310\Library\usr\bin;     
    C:\Users\sunny\miniconda3\envs\py310\Library\bin;     
    C:\Users\sunny\miniconda3\envs\py310\Scripts;    
    C:\Users\sunny\miniconda3\envs\py310\bin;      
    .;${env:PATH}   
    
    ms-python.debugpy: 
    `PATH=${env:PATH};c:\Users\sunny\.vscode\extensions\ms-python.debugpy-2025.10.0-win32-x64\bundled\scripts\noConfigScripts`  
    
    ms-python.debugpy:
    PATH= is missing here! ${env:PATH};
    

    You can see that the PATH concatenation of ms-python.debugpy discards the paths such as ms-python.python conda environment, causing Python to fail to execute correctly!

    The python-debugger plugin rudely discards the activated python environment PATH variable and only uses the ${env:PATH}; part.

  3. theholy7 commented on Jul 17, 2025

    @theholy7

    Is it #748 that broke it?

  4. juntaosun commented on Jul 17, 2025

    @juntaosun
    Author

    I'm not sure what happened before, but the latest version shows that there is a serious BUG in the environmental contribution.

  5. juntaosun commented on Jul 17, 2025

    @juntaosun
    Author

    José Antunes (@theholy7) Try adding this to your User settings.json and reload:
    Now, you can switch Python environments freely and conda activation works normally.

    尝试将以下内容添加到您的用户 settings.json 并重新加载:
    现在,可以自由切换 python 环境,conda 激活正常。

    settings.json:

    "python.experiments.optOutFrom": ["pythonTerminalEnvVarActivation"]
    
    Image
  6. theholy7 commented on Jul 17, 2025

    @theholy7

    For now I just turned off the debugger. I don't use it. Thank you for the tips though :)

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    triage-neededNeeds assignment to the proper sub-team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions