Repository navigation
On Windows + git-bash activate command uses the wrong script #904
Copy link
Copy link
Closed as not planned
Labels
bugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bugimportantIssue identified as high-priorityIssue identified as high-priorityinfo-neededIssue requires more information from posterIssue requires more information from postertriage-needed
Description
On Windows and using git-bash as my main shell and version 1.8.0 of the extension, when creating a new terminal, the extension tries to source a .bat file, which obviously leads to errors:
$ source C:/Tools/miniforge3/Scripts/activate.bat pipes
bash: C:/Tools/miniforge3/Scripts/activate.bat: line 1: syntax error near unexpected token `('
bash: C:/Tools/miniforge3/Scripts/activate.bat: line 1: `@REM Copyright (C) 2012 Anaconda, Inc'If it had used the Scripts/activate bash script, the activation would have worked.
The logs from the extension shows the following:
2025-10-07 13:28:51.609 [info]
=== Python Envs Configuration Levels ===
2025-10-07 13:28:51.609 [info] {
"section": "Python Envs Configuration Levels",
"defaultEnvManager": {
"workspaceFolderValue": "undefined",
"workspaceValue": "ms-python.python:conda",
"globalValue": "undefined",
"defaultValue": "ms-python.python:venv"
},
"defaultPackageManager": {
"workspaceFolderValue": "undefined",
"workspaceValue": "ms-python.python:conda",
"globalValue": "undefined",
"defaultValue": "ms-python.python:pip"
}
}
2025-10-07 13:28:51.609 [info] Starting Python Locator c:\Users\XXX\.vscode\extensions\ms-python.vscode-python-envs-1.8.0-win32-x64\python-env-tools\bin\pet.exe server
2025-10-07 13:28:51.609 [info] Using conda from settings: C:\Tools\miniforge3\Scripts\conda
2025-10-07 13:28:51.609 [info] Found global conda sourcing script at: C:\Tools\miniforge3\Scripts\activate.bat
2025-10-07 13:28:51.609 [info] Conda hook found at: C:\Tools\miniforge3\shell\condabin\conda-hook.ps1
2025-10-07 13:28:51.609 [info] conda.sh found in C:\Tools\miniforge3\etc\profile.d\conda.sh
2025-10-07 13:28:51.609 [info] Conda Sourcing Status:
├─ Conda Path: C:\Tools\miniforge3\Scripts\conda
├─ Conda Folder: C:\Tools\miniforge3
├─ Active on Launch: false
├─ Global Sourcing Script: C:\Tools\miniforge3\Scripts\activate.bat
└─ Shell-specific Sourcing Scripts:
├─ C:\Tools\miniforge3\shell\condabin\conda-hook.ps1
├─ C:\Tools\miniforge3\etc\profile.d\conda.sh
└─ C:\Tools\miniforge3\Scripts\activate.bat
2025-10-07 13:28:51.721 [info] Refreshing conda environments
2025-10-07 13:28:51.785 [warning] Failed to open HKLM\Software\Python\PythonCore\2.7\InstallPath, Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." }
2025-10-07 13:28:51.869 [info] Discovered manager: (Conda) C:\Tools\miniforge3\Scripts\conda.exe
2025-10-07 13:28:51.869 [info] Discovered env: C:\Tools\miniforge3\python.exe
2025-10-07 13:28:51.870 [warning] Failed to open HKLM\Software\Python\PythonCore\3.12\InstallPath, Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." }
2025-10-07 13:28:51.870 [warning] Failed to open HKCU\Software\Python, Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." }
2025-10-07 13:28:51.904 [info] Discovered env: C:\Users\XXX\.conda\envs\pipes\python.exe
2025-10-07 13:28:51.904 [info] Locator Conda took 146.7938ms
2025-10-07 13:28:51.904 [info] Locator PipEnv took 19.8µs
2025-10-07 13:28:51.904 [info] Locator Pixi took 378.1µs
2025-10-07 13:28:51.905 [info] Locator Poetry took 4.9687ms
2025-10-07 13:28:51.905 [info] Locator PyEnv took 2.6611ms
2025-10-07 13:28:51.905 [info] Locator Venv took 248µs
2025-10-07 13:28:51.905 [info] Locator VirtualEnv took 21.7µs
2025-10-07 13:28:51.905 [info] Locator VirtualEnvWrapper took 523.9µs
2025-10-07 13:28:51.905 [info] Locator WindowsRegistry took 11.6331ms
2025-10-07 13:28:51.905 [info] Locator WindowsStore took 1.2361ms
2025-10-07 13:28:51.905 [info] Locator GlobalVirtualEnvs took 2.7606ms
2025-10-07 13:28:51.905 [info] Locator Locators took 148.3021ms
2025-10-07 13:28:51.906 [info] Locator Path took 13.8824ms
2025-10-07 13:28:51.906 [info] Locator Workspaces took 15.8414ms
2025-10-07 13:28:51.906 [info] Using conda from settings: C:\Tools\miniforge3\Scripts\conda
2025-10-07 13:28:51.908 [info] Found local activation script at: C:\Tools\miniforge3\Scripts\activate, adding to cache.
-- later, when finding the environments
2025-10-07 13:28:51.909 [info] === Conda Shell Activation Map Generation ===
Environment Configuration:
- Identifier: "base"
- Prefix: "C:\Tools\miniforge3"
- Name: "base"
Local Activation:
- Status: Found
- Path: C:\Tools\miniforge3\Scripts\activate
Preferred Sourcing:
- Selected Path: C:\Tools\miniforge3\Scripts\activate
- Source: Local
✓ Using Windows-specific activation configuration
==========================================
2025-10-07 13:28:51.909 [info] Found base environment: C:\Tools\miniforge3
2025-10-07 13:28:51.910 [info] Conda hook found at: C:\Tools\miniforge3\shell\condabin\conda-hook.ps1
2025-10-07 13:28:51.911 [info] === Conda Shell Activation Map Generation ===
Environment Configuration:
- Identifier: "pipes"
- Prefix: "C:\Users\XXX\.conda\envs\pipes"
- Name: "pipes"
Local Activation:
- Status: Not Found
- Path: N/A
Preferred Sourcing:
- Selected Path: C:\Tools\miniforge3\Scripts\activate.bat
- Source: Global
✓ Using Windows-specific activation configuration
==========================================
2025-10-07 13:28:51.911 [info] Found named environment: C:\Users\XXX\.conda\envs\pipes
2025-10-07 13:28:51.911 [info] Conda hook found at: C:\Tools\miniforge3\shell\condabin\conda-hook.ps1
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bugimportantIssue identified as high-priorityIssue identified as high-priorityinfo-neededIssue requires more information from posterIssue requires more information from postertriage-needed
Activity
eleanorjboyd commentedon Oct 7, 2025
will investigate thanks!
eleanorjboyd commentedon Oct 7, 2025
Will continue to investigate but if you have a moment in the meantime can you reload your window, and search for this in your logs and include the logging around it
=== Conda Sourcing Shell Script Search ===? Trying to figure out where it is searching for sourcing scriptsezk84 commentedon Oct 17, 2025
Tried this, but I didn't find any instances of
=== Conda Sourcing Shell Script Search ===at all in my Python Environments logs, or any other logs for that matter.eleanorjboyd commentedon Jan 13, 2026
can you change your log level- this might be the issue:
Ctrl+Shift+PorCmd+Shift+Pon Mac).github-actions commentedon Jan 28, 2026
Because we have not heard back with the information we requested, we are closing this issue for now. If you are able to provide the info later on, then we will be happy to re-open this issue to pick up where we left off.
Happy Coding!