Skip to content

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

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

Closed
suvayu opened this issue Sep 29, 2019 · 2 comments
Closed

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

suvayu opened this issue Sep 29, 2019 · 2 comments
Assignees

Comments

@suvayu
Copy link

suvayu commented Sep 29, 2019

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%
@ghost ghost added the triage-needed Needs assignment to the proper sub-team label Sep 29, 2019
@ghost ghost removed the triage-needed Needs assignment to the proper sub-team label Sep 30, 2019
@karthiknadig
Copy link
Member

May be dupe of #7425

@karrtikr
Copy link

karrtikr commented Oct 1, 2019

There is no activate script in my path

You don't need to have it, we search for the activate script using path to conda interpreter. Anyways, we are moving to using conda run which runs an executable from within a conda environment without activating it. It won't need activate, so this would be fixing all these issues. Closing this in favor of #7425 .

@karrtikr karrtikr closed this as completed Oct 1, 2019
@ghost ghost removed the triage label Oct 1, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants