Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Environment Activation Fails: Direct Path to conda.bat Used Instead of conda Command After 2/7 Extension Update #24801

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
TuringTestChamp opened this issue Feb 8, 2025 · 3 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug important Issue identified as high-priority
Milestone

Comments

@TuringTestChamp
Copy link

TuringTestChamp commented Feb 8, 2025

Type: Bug

Behavior

Issue: conda environment not activating correctly
Problem started: 2/7/2025 (After the 2/7 update)
Setting affected: python.terminal.activateEnvironment
Extension version: 2025.0.0
VS Code version: Code 1.97.0 (33fc5a94a3f99ebe7087e8fe79fbe1d37a251016, 2025-02-04T22:41:26.688Z)
OS version: Windows 10 x64 10.0.19045

  • When launching a new terminal in PowerShell, the extension incorrectly uses the full path to conda.bat (e.g., D:\Users\username\miniconda3\Library\bin\conda.bat activate my_environment) to activate the environment, instead of the expected conda command (e.g., conda activate my_environment).

  • Note that the conda command works fine. The issue is only that the full path is being used in the python.terminal.activateEnvironment automation.

Terminal Log:
(base) PS D:\Users\username\dir> D:\Users\username\miniconda3\Library\bin\conda.BAT activate my_environment
(base) PS D:\Users\username\dir>

Steps to reproduce:

  1. Update the Python extension to the latest version as of February 7, 2025.
  2. Set the default terminal to PowerShell.
  3. Open a new terminal in Visual Studio Code.
  4. Observe that the full path to conda.bat is being invoked in place of the conda command in the environment activation process, preventing the environment from being activated correctly.
@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Feb 8, 2025
@karthiknadig karthiknadig added bug Issue identified by VS Code Team member as probable bug important Issue identified as high-priority and removed triage-needed Needs assignment to the proper sub-team labels Feb 10, 2025
@karthiknadig karthiknadig added this to the February 2025 milestone Feb 10, 2025
@karthiknadig
Copy link
Member

@TuringTestChamp Do you have python.condaPath setting set by any chance?

@TuringTestChamp
Copy link
Author

TuringTestChamp commented Feb 20, 2025

Image

@TuringTestChamp Do you have python.condaPath setting set by any chance?

Hi @karthiknadig -

Yes, it is set. It's been set to this path for over a year and I haven't had any other problems.

What are you trying to solve for-do you think it's local to my system? I did what I could w/ this setting, let me know if there's anything else I can check.

I just tried -

  • Removed the path and reverted to the default blank python.condaPath setting
  • Confirmed setting updated in JSON
  • Restarted VS Code
  • Launched Terminal
  • No change. Full path to conda.bat is still being used to activate the environment instead of conda command

ETA - Not sure how the activation is called so I'm not sure what else could be affecting it locally.

Here's my PATH info if that's relevant -

Image

@karthiknadig karthiknadig marked this as a duplicate of #24849 Feb 27, 2025
@karthiknadig karthiknadig modified the milestones: March 2025, April 2025 Mar 25, 2025
@karthiknadig karthiknadig modified the milestones: April 2025, May 2025 Apr 30, 2025
@TuringTestChamp
Copy link
Author

Image

Image

Hi @karthiknadig -

Just a heads up, there has just been a behavior change on my end. The conda command is now being sent to the terminal and the environment is happily activating! 😄 I'm assuming the change is due to the extension update 11 hours ago?

1 callout - When I start a new terminal in VS code, /miniconda3/Scripts/activate runs in an external command prompt. Before the 2/7 extension, I didn't have that external window pop up. Is this an expected result?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug important Issue identified as high-priority
Projects
None yet
Development

No branches or pull requests

2 participants