-
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
Starting VS Code from conda environment fails to activate that environment #23571
Comments
I disabled both settings and tried both variations of "inherit env". Whenever I run VS Code from an activated environment, only the base environment is activated in the integrated terminals. So, unfortunately, this did not work. |
BTW, this is certainly related to #22879 since before that, it worked just fine. |
I copy/pasted the output of the Python extension in VS Code in the case of running
Ad 2.: Since the extension correctly figures out the environment, it should be no problem to add to the path. It looks like the extension when running 'clean' takes the PATH from Another observation: VS Code claims: |
So, I guess the solution would be to execute steps 2 and 3 (see above) no matter when you're running from an activated environment or not. If I manually apply those two steps after creating a terminal, that terminal is fixed. |
Type: Bug
Behaviour
When starting Visual Studio Code from the terminal with a conda environment activated does say that environment is selected in the status bar (and with the 'run' button, scripts run using that environment's interpreter) but that environment is not activated in the terminal.
Steps to reproduce:
conda activate my_env
code .
my_env
is active, according to the statusbar.my_env
's Python interpreter.my_env
is activated.conda info
and see that only the
base
environment is activated.Alternatively, start VS Code from a fresh terminal using:
conda run -n my_env code .
with the same results.
Diagnostic data
NOTE: the environment I tested with was actually called
cli-board-manager
. Sorry about that.Output for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)Output for
Python Debugger
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython Debugger
)Extension version: 2024.4.1
VS Code version: Code - Insiders 1.88.0-insider (Universal) (be210b3a60c7d60030c1d3d92da00d008edf6ab9, 2024-03-15T05:49:14.505Z)
OS version: Darwin arm64 23.5.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
A/B Experiments
The text was updated successfully, but these errors were encountered: