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

No such file or directory: 'conda' #211

Open
cgahr opened this issue Mar 7, 2024 · 1 comment
Open

No such file or directory: 'conda' #211

cgahr opened this issue Mar 7, 2024 · 1 comment

Comments

@cgahr
Copy link

cgahr commented Mar 7, 2024

Description

On my system, I have only mamba installed and not conda. When running jupyter notebook, jupyter lab or gator, I get the following error message (sorry for the formatting, I tried to fix it as good as possible):

[E 2024-03-07 16:01:47.247 ServerApp.mamba_gator] Error for task 
{
  'type': 'FileNotFoundError', 
  'error': "[Errno 2] No such file or directory: 'conda'", 
  'message': "FileNotFoundError(2, 'No such file or directory')", 
  'traceback': []}

traceback:

  File "/home/cgahr/micromamba/envs/notebook/lib/python3.12/site-packages/mamba_gator/handlers.py", line 96, in execute_task
    result = await f(*args)
             ^^^^^^^^^^^^^^
  File "/home/cgahr/micromamba/envs/notebook/lib/python3.12/site-packages/mamba_gator/handlers.py", line 380, in update_available
    answer = await env_manager.list_available()
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/cgahr/micromamba/envs/notebook/lib/python3.12/site-packages/mamba_gator/envmanager.py", line 595, in list_available
    ans = await self._execute(self.manager, "search", "--json")
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/cgahr/micromamba/envs/notebook/lib/python3.12/site-packages/mamba_gator/envmanager.py", line 151, in _execute
    process = await current_loop.run_in_executor(
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/cgahr/micromamba/envs/notebook/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/cgahr/micromamba/envs/notebook/lib/python3.12/subprocess.py", line 1026, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/home/cgahr/micromamba/envs/notebook/lib/python3.12/subprocess.py", line 1953, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)

Furthermore, no environments are shown!

The error itself is not unexpected (at least for me), since I don't have conda installed on my system, I only have mamba!

However, my understanding was that I don't need conda to rungator.

This seems to be a bug to be, but any help is appreciated!

EDIT: I looked through envmanager.py and might have found a possible issue. In line 200, you call which mamba to get the executable of mamba. In my case, I installed mamba via nix, which only provides micromamba. For ease of usage, I aliased mamba to micromamba. In this case however, line 200 return mamba: aliased to micromamba which breaks the command.

EDIT 2: I created a script mamba which correctly resolves to the micromamba executable. Now I get the following error (in the jupyter log):

  File "/home/cgahr/micromamba/envs/notebook/lib/python3.12/site-packages/mamba_gator/handlers.py", line 96, in execute_task
    result = await f(*args)
             ^^^^^^^^^^^^^^
  File "/home/cgahr/micromamba/envs/notebook/lib/python3.12/site-packages/mamba_gator/handlers.py", line 380, in update_available
    answer = await env_manager.list_available()
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/cgahr/micromamba/envs/notebook/lib/python3.12/site-packages/mamba_gator/envmanager.py", line 595, in list_available
    ans = await self._execute(self.manager, "search", "--json")
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/cgahr/micromamba/envs/notebook/lib/python3.12/site-packages/mamba_gator/envmanager.py", line 151, in _execute
    process = await current_loop.run_in_executor(
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/cgahr/micromamba/envs/notebook/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/cgahr/micromamba/envs/notebook/lib/python3.12/subprocess.py", line 1026, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/home/cgahr/micromamba/envs/notebook/lib/python3.12/subprocess.py", line 1953, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)

Reproduce

  1. Install environment (below)
  2. Run jupyter notebook, jupyter lab or gator
  3. Don't find any mamba environment
# environment.yml
name: notebook
channels:
  - conda-forge
  - defaults
dependencies:
  - python>=3.11
  - jupyterlab
  - notebook
  - mamba_gator
  - pip

Expected behavior

Detect all installed environments:

$ mamba env list
  Name            Active  Path
──────────────────────────────────────────────────────────────────────
  base                    /home/cgahr/micromamba
  notebook        *       /home/cgahr/micromamba/envs/notebook
  qmk                     /home/cgahr/micromamba/envs/qmk

Context

  • Python package version: 5.2.1
  • Extension version:
$ jupyter labextension list
JupyterLab v4.1.3
/home/cgahr/micromamba/envs/notebook/share/jupyter/labextensions
        jupyterlab_pygments v0.3.0 enabled OK (python, jupyterlab_pygments)
        @jupyter-notebook/lab-extension v7.1.1 enabled OK
        @mamba-org/gator-lab v3.1.0 enabled  X (python, mamba_gator)                                                                                                             
                                                                                                             
   The following extensions are outdated:
        @mamba-org/gator-lab
                                                                                                          
   Consider checking if an update is available for these packages.                                                                                                             
  • General information:
$ mamba info
                                                                                                                     
       libmamba version : 1.5.4
     micromamba version : 1.5.4
           curl version : libcurl/8.5.0 OpenSSL/3.0.12 zlib/1.3 brotli/1.1.0 zstd/1.5.5 libidn2/2.3.4 libssh2/1.11.0nghttp2/1.57.0
     libarchive version : libarchive 3.7.2 zlib/1.3 liblzma/5.4.5 bz2lib/1.0.8 libzstd/1.5.5
       envs directories : /home/cgahr/micromamba/envs
          package cache : /home/cgahr/micromamba/pkgs
                          /home/cgahr/.mamba/pkgs
            environment : notebook (active)
           env location : /home/cgahr/micromamba/envs/notebook
      user config files : /home/cgahr/.mambarc
 populated config files :
       virtual packages : __unix=0=0
                          __linux=6.2.0=0
                          __glibc=2.38=0
                          __archspec=1=x86_64-v3
               channels :
       base environment : /home/cgahr/micromamba
               platform : linux-64
Command Line Output
could not paste the log, I hit the 65k character limit
Browser Output
Paste the output from your browser Javascript console here.
@PaulKGrimes
Copy link

PaulKGrimes commented Sep 12, 2024

I have this same issue with jupyterhub (installed in a micromamba environment, and running as a dedicated user). Setting CONDA_EXE=/opt/mamba/bin/micromamba as an environment variable for the systemd service does not help.

However, after installing mamba_gator in my jupyterhub environment, I'm not getting the same error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants