-
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
conda activate from subprocess #23367
Comments
@balazon Can you share what the |
external terminal PATH: vscode terminal PATH: Interesting is that conda is here: |
@balazon It looks like the conda path is probably getting added via
That should use the same PATH variable as your external terminal, and then the behavior should match. |
This works yes thank you. Just curious though: how does vscode still manage to find conda after not having it anywhere in PATH, when I launch it from applications, and not from terminal? |
It looks for PATH first, then has an internal known paths list that it goes through for each platform. If it can't find there, then it reverse engineers the path to conda by looking at |
Thank you for clearing that up, I suppose this issue can be closed |
Type: Bug
Behaviour
I'm trying to do a simple thing where I activate another environment and run some code in that environment, using subprocess.check_call.
I know I should be able to do that without conda activate myenv, and then running my command with conda run command.
But the problem is conda command is not found (not in PATH?) somehow. So I can't even do a version check, much less something like running a command in a different environment.
I get
FileNotFoundError: [Errno 2] No such file or directory: 'conda'
Is there a workaround for this? Is this expected behavior? It's not my usual workflow I know. Usually I just run commands in a single environment, and that's it, but this just came up, so I'm wondering if it's possible.
Steps to reproduce:
I expect something like
conda 23.3.1
as my output which works in a separate terminal window, but in vscode terminal I get:
Diagnostic data
Output for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)Extension version: 2024.6.0
VS Code version: Code 1.89.0 (b58957e67ee1e712cebf466b995adf4c5307b2bd, 2024-05-01T02:08:25.066Z)
OS version: Linux x64 6.2.0-26-generic
Modes:
python.languageServer
setting: DefaultUser Settings
Installed Extensions
System Info
canvas_oop_rasterization: disabled_off
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: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
A/B Experiments
The text was updated successfully, but these errors were encountered: