Description
Conda activation failing for a number of users in Jupyter extension
Over the past few months I've been seing a lot of bugs filed by users with logs containing the following
CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.
To initialize your shell, run
$ conda init <SHELL_NAME>
Currently supported shells are:
- bash
- fish
- tcsh
- xonsh
- zsh
- powershell
See 'conda init --help' for more information and options.
These are either users on SSH, WSL, and even local
I understand that getting conda working for everyone isn't easy.
& Jupyter extension has code to work around some of the issues in Python extension as well.
I'd like to
- Get rid of the hacks in the Jupyter extesnion and always rely on Python extension to activate any enviornment
- Try to get some of the hacks/fall backs into the Python extension
- Come up with a plan on what we do when users are unable to get some conda enviornments working
- Do we inform users that Conda versions <= n are not supported
- Do we inform users that Conda in WSL, SSH, etc are not supported until and unless...
- Etc
Note: Today we don't have as many failures as we should because we have custom code in Jupyter extension that serves as a fall back when Python exesnion fails to activate the Conda enviornment.
https://github.com/DonJayamanne/vscode-jupyter/blob/main/src/platform/common/process/environmentActivationService.node.ts#L306
This is something I have already shared with @karrtikr @karthiknadig some time ago in a few meetings.
This will ensure more users will continue to have success with Conda envionments.
Else we'd have to continue to implement work arounds in Jupyter extension to keep resolving these activation issues, and reverting these changes would only result in breaking existing user.
Some related issues
- Kernel not starting, conda environment errors on remote SSH #19965
- conda environment fails to load properly on remote machine #11324
- Failure to activate Conda Environments created using the --prefix argument (on Unix) #18044
- Issues with new conda env on WSL vscode-jupyter#11813
I believe the soliution identified here #19965 (comment) would solve a large number of these issues (including WSL, SSH and the like). I.e. fall back to old actiavtion when conda run
fails. However @karrtikr might have a better solution and more ideas on what could be improved.