Skip to content

Notify users to upgrade conda when applicable #20087

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
DonJayamanne opened this issue Oct 26, 2022 · 10 comments
Closed

Notify users to upgrade conda when applicable #20087

DonJayamanne opened this issue Oct 26, 2022 · 10 comments
Labels
area-environments Features relating to handling interpreter environments feature-request Request for new features or functionality

Comments

@DonJayamanne
Copy link

DonJayamanne commented Oct 26, 2022

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

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.

@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Oct 26, 2022
@karrtikr karrtikr removed their assignment Oct 26, 2022
@brettcannon
Copy link
Member

What's the activation for? Just for a terminal, or for running commands? If it's the former then Kartik has started to look into this and has an initial plan to try out. If it's the latter than we are moving to conda run under the guidance of the conda team who have asked people to file bugs with them when something doesn't work.

@DonJayamanne
Copy link
Author

If it's the latter than we are moving to

Its the latter

@brettcannon
Copy link
Member

Then the conda has asked us to have users (or us personally when we are so motivated) to file bugs at https://github.com/conda/conda/issues and work towards adopting conda run. https://github.com/conda/conda/releases/tag/22.9.0 has the last critical bug fixed for us to completely switch over (debugging is our last execution context that isn't using conda run). We are now waiting for conda to tell us what their support timelines are for conda versions before we switch debugging over completely and tell users we only support conda 22.9 and newer only.

Do you know what version of conda people who are having problems are running? We found a lot of users having issues were using versions like conda 4.8 which is nearly 3 years old. Once we asked them to upgrade (which no one actually balked at), the situation improved.

@karrtikr karrtikr added the area-environments Features relating to handling interpreter environments label Oct 31, 2022
@brettcannon brettcannon added the info-needed Issue requires more information from poster label Oct 31, 2022
@DonJayamanne
Copy link
Author

Do you know what version of conda people who are having problems are running? We found a lot of users having issues were using versions lik

No i don't

@DonJayamanne
Copy link
Author

DonJayamanne commented Nov 1, 2022

Once we asked them to upgrade (which no one actually balked at), the situation improved.

I'm hoping for a solution as follows, i.e. unblock users without having to wait for for users to file a bug at our end to be notified of a solution
E.g

  • Jupyter extnesion calls into Python extension to activate a Conda env
  • Python extension determins the conda version etc, and realizes the fact that conda needs an update
  • Some how Jupyter extension/Python extension will then notify/prompt the user to update Conda

This way users are able to unblock themselves without having to reach out to us.

@brettcannon
Copy link
Member

  • Jupyter extnesion calls into Python extension to activate a Conda env

We're working on a potentially new way to activate terminals. Until that's done there's no plan for an API (although if we do end up using the environment context API for terminals then everyone gets the activation for "free").

  • Python extension determins the conda version etc, and realizes the fact that conda needs an update

We are still waiting for conda to tell us what their support timelines are going to be. Once we have that we could potentially notify users that they are outside of support. But I'm not sure if we want to do that as it's not a guarantee things won't work, just that we don't make a guarantee things will work. This is why we don't tell e.g. Python 3.6 users they are unsupported even though debugpy doesn't work; if you just use the run button then everything works out fine.

@karrtikr
Copy link

We've changed code for fetching environment variables to use conda run instead, so users should no longer to be running into this error. Keeping this issue open to potentially help users that are outside of support to upgrade conda.

@karrtikr karrtikr changed the title Conda activation failing for a number of users in Jupyter extension Notify users to upgrade conda when applicable Dec 14, 2022
@karrtikr karrtikr removed their assignment Dec 14, 2022
@karrtikr karrtikr added feature-request Request for new features or functionality needs spike Label for issues that need investigation before they can be worked on. and removed triage-needed Needs assignment to the proper sub-team labels Dec 14, 2022
@karrtikr
Copy link

Btw, I'm not able to reproduce this issue on SSH or WSL, if you can provide reproducible steps that would help investigate why conda activate commands failing despite shell already being initialized.

@prasiyer
Copy link

prasiyer commented Feb 13, 2023

@DonJayamanne
Hello - I was getting the error similar to #19965 and #11207

5:44:15.096: Failed to get activated conda env variables from Python for "Environment"

Switching to pre-release version of Jupyter extension fixed the issue. Is the root cause related to the version of Conda or something else? Please advise. I would like to know so that I prevent this issue from happening again.

@karrtikr
Copy link

We stop using conda activate commands entirely with #11039 so folks should no longer run into it, hence such a notification is likely not needed.

@karrtikr karrtikr closed this as not planned Won't fix, can't repro, duplicate, stale Sep 11, 2023
@github-actions github-actions bot removed the needs spike Label for issues that need investigation before they can be worked on. label Sep 11, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-environments Features relating to handling interpreter environments feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

4 participants