-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Terminal does not activate my ".conda" environment that is selected as "Current Interpreter" #24472
Comments
@jpfeuffer Can you share the exact setting you are using (i.e., can you share the settings.json content)? Python extension only has the following settings for activation: We detect prefixed vs named environments, so it should use the correct command. |
Now it doesn't even try to find my environment anymore. I don't get any logs of your extension trying to set my .conda environment... My only python settings are: "python.venvPath": "....../pypoetry/virtualenvs", python.terminal.activateEnvInCurrentTerminal is ON by default as far as I can see. |
I tried with and without python.terminal.activateEnvInCurrentTerminal. Both do not work. |
Ok, so with python locator = js it just does nothing. In summary: nothing works. |
You do detect prefixed environments for stuff like pylance, but not for activation in the shell. |
I encountered the same issue too, which only started occurring for me this morning. When I open a new terminal, I have to manually activate the environment with My
|
@karthiknadig I can confirm the problem persists on both versions (I was originally using v2024.14.1, and just tested v2024.16.1). |
I ended up creating a new Conda environment outside of VSCode (e.g., |
But this is a named environment. I want my environment in the development folder of my vscode project (under .conda). |
I just come accross with same behavior now, I am using path environments with conda, it used to activate like Not sure when it got changed because I opted out of vscode updates because of breaking changes, I do update at some occasions to get new features on a spare time. EDIT: Looks like some things have changed since v2024.10.0:
|
This might be a bug in new discovery code. I am investigating. Try changing the value of “Python.locator” setting from “js” to “native”. I will share a build to try after I have a fix. |
Did not work for me with v2024.20.0. |
I encountered the same issue, and it is resolved by switching to v2024.10.0. |
I am having this same issue. I have noticed it specifically when using a conda environment created using --path instead of --name. From the extension logs, it looks like the integrated terminal is trying to using --name for things even if the environment was created with a path (which happens by default when creating a new conda environment through the command pallette)
For me |
same issue |
after switching previous issues output. python plugin version
|
Same issue, works again when downgrading to v2024.10.0, thanks @Duoquote |
If you have a Windows or Linux machine, can you try this build and see if it works for you: win-x64: https://github.com/microsoft/vscode-python/actions/runs/12214878572/artifacts/2288984827 To install run the "Install from VSIX command". |
Popping in here as I noticed having this issue as well. And i also found that reverting to 2024.10 fixed the issue. As for the builds linked by @karthiknadig
|
@Pa3ckP7 I am not able to repo this with the build I gave you. This is what I see:
would it be possible to share the output of |
Ran the |
Ok Update on this. The extension installed with VSIX works for my air-farming, but not for HCI or R1p3r. Which is quite a bit odd EDIT: I compared settings between air-farming and r1p3r. And apart from one being a workspace and the other not. Do discernable difference. I tried creating a workspace with same setting as air-famring in r1p3r, but that was not the issue |
@Pa3ckP7 I have another version with bit more logging, and a bit of logic improvements. Can you try this, and share the logs? win32-x64: https://github.com/microsoft/vscode-python/actions/runs/12236450388/artifacts/2293834228 |
sure~
…---Original---
From: "Karthik ***@***.***>
Date: Mon, Dec 9, 2024 21:45 PM
To: ***@***.***>;
Cc: "Zou ***@***.******@***.***>;
Subject: Re: [microsoft/vscode-python] Terminal does not activate my ".conda"environment that is selected as "Current Interpreter" (Issue #24472)
@Pa3ckP7 I have another version with bit more logging, and a bit of logic improvements. Can you try this, and share the logs?
win32-x64: https://github.com/microsoft/vscode-python/actions/runs/12236450388/artifacts/2293834228
win32-arm64: https://github.com/microsoft/vscode-python/actions/runs/12236450388/artifacts/2293834227
linux-x64: https://github.com/microsoft/vscode-python/actions/runs/12236450388/artifacts/2293834224
alpine-x64: https://github.com/microsoft/vscode-python/actions/runs/12236450388/artifacts/2293834221
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: ***@***.***>
|
@karthiknadig Switching to this version seems to solve the problem. Here is the log after switching to your version.
|
@karthiknadig sorry for late reply here is your more debugging thing
|
Ok small noteworthy update js locator correctly detected it to be a path not a named environment. Bug appears to be with the native locator as the js locator works fine even on the new 2024.22 build |
I confirm the switching Python.locator to: native->js-native fixes the problem also in plugin version 2024.22.0
|
Try pre-release version 2024.23 that has the fix for this. via #24553 |
Hello @karthiknadig , PS D:\Projects\ainotebook> C:/Users/miesz/miniconda3/Scripts/activate |
Re-opening the issue, since it doesn't look like it is addressed. |
For me native flat out doesn't work. If I am on JS it will work fine even with reloads. Native however won't work at all with reloads |
Would it be possible to share the logs (Output > Python ), and the activation command used in both (js and native) cases? I am trying to figure out why the two behave differently, when they have the same info. |
Here you go Js locator and |
One comment about the native->js->native. One needs to rotate the change like that. And it works while the vs studio is running. Let me check if rotating this setting solves the problem persistenly (after restart of VSC) |
Digging into this, I was able to repro it with v2024.23.2024121003
It seems to be fixed in v2024.23.2024121201:
|
Type: Bug
Behaviour
When I open a new zsh terminal in VSCode, although I activated "activateActiveEnvironmentInTerminal" (or how this settings is called), it only loads the conda base environment.
My .conda environment in the same folder is correctly selected and displayed in the lower right corner of VSCode. And I can activate it easily with
conda activate ./.conda
Steps to reproduce:
The problem is that you command tried to run
conda -n .conda
and notconda -p .conda
. This is a PREFIX environment not a NAMED environment..Diagnostic data
Output for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)Extension version: 2024.20.0
VS Code version: Code 1.95.3 (Universal) (f1a4fb101478ce6ec82fe9627c43efbf9e98c813, 2024-11-13T14:50:04.152Z)
OS version: Darwin arm64 23.6.0
Modes:
python.languageServer
setting: DefaultUser Settings
Installed Extensions
System Info
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
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
A/B Experiments
The text was updated successfully, but these errors were encountered: