gator
gator copied to clipboard
No such file or directory: 'conda'
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
- Install environment (below)
- Run
jupyter notebook,jupyter laborgator - 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.
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.
Hi @cgahr, if I understand this issue correctly, are you proposing a feature request that Gator supports micromamba? It looks like you are trying to use micromamba as mamba, and Gator doesn't support that currently - so as a fallback it is trying to find Conda.
Ran into this today and can confirm that switching to a miniforge installation with mamba worked just fine. Still it would be nice for this to work with micromamba, because of the simpler installation as a standalone binary.
It has been a long time so I don't remember all the details since my software stack has changed since.
IIRC I thought that micromamba = mamba, or at least that micromamba should be usable as a replacement for mamba. This wasn't the case, hence the report.
In practice, maybe it would be sufficient to expose a way to configure the mamba/conda/whatever executable.