Skip to content

Cannot activate environment with (system-wide) conda #7671

Closed
@suvayu

Description

@suvayu

Issue Type: Bug

I have a system wide conda install (/usr/bin/conda). While vscode detects all my conda environments correctly, it fails to activate them correctly, leading to various things not working, like test discovery, starting a jupyter server, etc.

$ conda env list 
# conda environments:
#
aif360                 /home/user/.conda/envs/aif360
arcade                 /home/user/.conda/envs/arcade
decrypted              /home/user/.conda/envs/decrypted
outage                 /home/user/.conda/envs/outage
pa-dev                 /home/user/.conda/envs/pa-dev
py36                   /home/user/.conda/envs/py36
py36-microscopy        /home/user/.conda/envs/py36-microscopy
py37                   /home/user/.conda/envs/py37
base               *   /usr

My understanding is conda calls source activate <env> or equivalent to activate and environment. There is no activate script in my path, so this fails. I have tried setting python.condaPath to /usr/bin/conda, but all it does is call source /usr/bin/activate <env> instead; again that fails.

I found an old issue (#1882) that points to something like my problem, but I couldn't quite find a resolution. If there was an easy way to configure what command is used to activate an environment, that would be great. Maybe a list of command templates that can be tried in order until one succeeds, ["conda activate <env>", "source activate <env>", "workon <env>", ...] and so on.

Extension version: 2019.10.38574-dev
VS Code version: Code - Insiders 1.39.0-insider (e0762af, 2019-09-27T05:26:55.061Z)
OS version: Linux x64 5.1.20-300.fc30.x86_64
Remote OS version: Linux x64 5.2.14-200.fc30.x86_64

System Info
Item Value
CPUs AMD Ryzen 5 2400G with Radeon Vega Graphics (8 x 1811)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
protected_video_decode: unavailable_off
rasterization: disabled_software
skia_renderer: disabled_off
surface_control: disabled_off
surface_synchronization: enabled_on
video_decode: unavailable_off
viz_display_compositor: enabled_on
viz_hit_test_surface_layer: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) 3, 2, 2
Memory (System) 29.45GB (1.55GB free)
Process Argv --unity-launch --no-sandbox
Screen Reader no
VM 0%
Item Value
Remote SSH: dasa
OS Linux x64 5.2.14-200.fc30.x86_64
CPUs Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz (8 x 800)
Memory (System) 7.68GB (0.29GB free)
VM 0%

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions