Skip to content
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

Unable to use Conda installed in Programdata #872

Open
Aelindgard opened this issue Sep 24, 2024 · 5 comments
Open

Unable to use Conda installed in Programdata #872

Aelindgard opened this issue Sep 24, 2024 · 5 comments
Labels
bug os:windows Problems specific to Microsoft Windows

Comments

@Aelindgard
Copy link

Description

When using an installation of Miniconda that installs into "C:\Programdata", Jupyterlab does not recognise conda.exe
image

Reproduce

  1. Go to 'settings'
  2. Click on 'Select Path' for 'conda path'
  3. Select "C:\ProgramData\miniconda3\Scripts\conda.exe"
  4. See error "not valid conda executable, TypeError, path argument must be type string. Received undefined.'

Expected behavior

The conda.exe should be recognised.

Context

  • Operating System and version: Windows 11
  • JupyterLab-Desktop version: 4.2.5-1
  • Installer: .exe
@JasonWeill
Copy link

@Aelindgard Thank you for opening this issue! I'm curious whether the backslashes in the path are causing the string to be parsed incorrectly. If you use slashes, such as C:/ProgramData/miniconda3/…, do you see the same error? Windows supports both delimiters for paths.

@Aelindgard
Copy link
Author

Hi @JasonWeill have tried with forward slash for the path, same error is shown.

@JasonWeill JasonWeill added os:windows Problems specific to Microsoft Windows and removed status:Needs Info status:Needs Triage labels Sep 25, 2024
@richard-sim
Copy link

I have the same error on Windows 11, but with Conda (24.9.1, latest) installed in my user directory (the default location).

@richard-sim
Copy link

richard-sim commented Oct 14, 2024

@JasonWeill : Looking into this, I believe it's a bug for initial JupyterLab Desktop installs, when the conda path isn't set yet and there is no CONDA_EXE environment variable (which is only set when a Conda environment is activated).

The GUI calls validateCondaPath before setting the condaPath, which calls runCommandInEnvironment > getCondaPath (returns undefined) > passed to condaEnvPathForCondaExePath > path.dirname, which throws the exception.

See:

runCommandInEnvironment(

I think an appropriate fix would be to pass the path that's being validated to runCommandInEnvironment, and not call getCondaPath if one is provided.

@richard-sim
Copy link

A workaround is to set the CONDA_EXE environment variable in a command prompt before launching JupyterLab Desktop, and then making sure the conda path is correct in the Python environment settings. I re-set the conda path in the GUI (even though it was showing up correctly at the time), just to be sure that it was saved and JLD would work when not run with CONDA_EXE set.

e.g.

set CONDA_EXE=C:\Users\rsim\miniforge3\Scripts\conda.exe
jlab

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug os:windows Problems specific to Microsoft Windows
Projects
None yet
Development

No branches or pull requests

3 participants