jupyterlab-desktop icon indicating copy to clipboard operation
jupyterlab-desktop copied to clipboard

Environment selection dialog improvements

Open krassowski opened this issue 1 year ago • 7 comments

Description

As described in #477 the environment selection dialog is cumbersome to use. https://github.com/jupyterlab/jupyterlab-desktop/pull/478 addresses one of the issues (non-editable path), but a few UX annoyances remain:

  • user needs to navigate the hidden directories to find the Python executable; this should be a fallback, not a default
  • user is not told whether the selected environment meets the requirements until they click restart and apply

Expected behavior

I would like the environment selection dialog to try to detect available environments from known paths and offer to select one of them, with options like so:

  • use bundled environment
  • use conda environment
    • base,
    • my_conda_env_1,
    • my_conda_env_2
  • pyenv:
    • 3.7.5 [this environment does meet requirement: python>=3.8],
    • 3.9.5,
    • my_pyenv_virtualen_1 [this environment does meet requirement: juypterlab>=3.1],
    • my_pyenv_virtualen_2
  • use environment based on the path

We cannot and should not strive to cover all possible virtual environment management options, but instead we should cover 3-4 most popular options and make it modular for third parties to be welcome to make a pull request to add their own (and if falls out of use/is no longer maintained by the 3rd party, remove it easily).

The environments that do not meet requirements should always be shown

  • If the environment provider has support for updating packages, we should ask user if they want to update the package to required version (with a big red warning about the potential consequences) and if they don't want to proceed, then ask to choose a different environment.
  • If the environment provider has no support for updating packages (/python version), the environment should be shown as not selectable and greyed out

Context

  • Operating System and version: Linux Ubuntu 22
  • JupyterLab-Desktop version: 3.4.4
  • Installer: deb

krassowski avatar Aug 07 '22 15:08 krassowski

@krassowski can we close this now? arent the environment discovery and selector menu in 3.6.1-1 already covering these?

mbektas avatar Feb 13 '23 04:02 mbektas

I updated the title.

From the descriptions above I would still like to add pyenv discovery (in addition to conda) and especially the ability to grey out incompatible environments with useful message (as [this environment does meet requirement: python>=3.8] or [this environment does meet requirement: juypterlab>=3.1] suggested above).

krassowski avatar Feb 13 '23 09:02 krassowski

Another user struggling with custom environment https://stackoverflow.com/q/77102935/

krassowski avatar Sep 14 '23 08:09 krassowski

Yet another user struggling with selecting custom environment due to lack of feedback on requirements: https://github.com/jupyterlab/jupyterlab-desktop/issues/704

krassowski avatar Sep 14 '23 08:09 krassowski

Another closely related issue: https://github.com/jupyterlab/jupyterlab-desktop/issues/594

krassowski avatar Sep 14 '23 08:09 krassowski

I just wanted to comment to say that I ended up here because I was struggling to understand how to use JupyterLab Desktop with a custom environment and to offer my thoughts on how the first-run experience might be improved. Ultimately, the problem was that I did not have jupyterlab installed in the environment I was trying to use.

It seems obvious in hindsight that it is necessary to have jupyterlab installed first, but it hadn't occurred to me. I see from other posters that this is a common oversight. I suspect this is because the act of downloading JupyterLab Desktop obscures the fact that you still need to download jupyterlab. I understand why you still need to download and install jupyterlab separately if you want to use a custom environment, but I think my brain ticked the "download jupyter" checkbox when I downloaded Desktop, so I didn't even consider that might be the problem until I read through several Issues here.

The other reason I did not consider that the problem was that I didn't have jupyterlab installed is that the message displayed on the welcome screen does not identify that as the problem. On first launch, the welcome screen displays the message:

"⚠️ Python environment not found. Install using the bundled installer or Change the default Python environment"

After entering the path to the python binary in my virtual environment in Settings and "Apply & restart"ing, the message did not change. Because the message was still the same one that had been there before I selected a python binary, I believed the issue must be with the path I had entered or with the binary itself (or with JupyterLab Desktop). As mentioned in the OP, having an indication that an environment has been found but does not meet requirements would be a big help here.

As a last thought, it would also be helpful to highlight the fact that the "Install using the bundled installer" and "Change the default Python environment" text are links to Settings. As it stands now, the whole message is displayed in the same (or near enough the same as to be indistinguishable) color and changes color by a barely perceptible amount when moused over. Before I was able to follow the message's instructions and set my python environment, I had to discern how to do that. Because the app does not follow Mac OS conventions and put Settings in the application menu or use the ⌘, shortcut, and there is no obvious way to enter Settings from the welcome screen, it took me a few minutes to find it. Making the message text into obvious links would help, as would adding a Settings link below

  • New notebook…
  • New session…
  • Open…
  • Connect…

That way there would always be a clear way to get to settings from the welcome screen, even without the warning message. I know (now) that Settings is under the hamburger menu and that that menu persists even after entering a session, but having something that stands out on the welcome screen would make the first-run (or first-run after a long time, so you've forgotten where everything is) experience easier.

Just my two cents. I hope it can help someone who finds this while struggling with the same issues I was or prevent them from struggling in the first place.

  • Apple M2
  • Mac OS Ventura 13.6
  • JupyterLab Desktop 4.0.5-1
  • Python 3.11.5
  • pyenv 2.3.27
  • pyenv-virtualenv 1.2.1

TRezendes avatar Sep 22 '23 20:09 TRezendes

@TRezendes thanks for the detailed feedback you shared. I am currently working on showing more detailed error messages when the custom environment is not compatible along with other enhancements.

mbektas avatar Oct 04 '23 16:10 mbektas