jupyterlite / xeus

JupyterLite loader for Xeus kernels
https://jupyterlite-xeus.readthedocs.io
BSD 3-Clause "New" or "Revised" License
22 stars 12 forks source link

error libmamba Non-conda folder exists at prefix #122

Open njzjz opened 1 week ago

njzjz commented 1 week ago

Description

I got the following error in readthedocs:

error    libmamba Non-conda folder exists at prefix
critical libmamba Aborting.
[LiteBuildApp] ERROR | [lite] [post_build] [jupyterlite-xeus] [ERR] Command '['/home/docs/checkouts/readthedocs.org/user_builds/dpdata/conda/735/bin/mamba', 'create', '--yes', '--prefix', PosixPath('/tmp/tmp7yjenfp5/env/envs/dpdata-emscripten'), '-c', 'https://repo.mamba.pm/emscripten-forge', '-c', 'conda-forge']' returned non-zero exit status 1.
Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/dpdata/conda/735/lib/python3.12/site-packages/doit/doit_cmd.py", line 294, in run
    return command.parse_execute(args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/docs/checkouts/readthedocs.org/user_builds/dpdata/conda/735/lib/python3.12/site-packages/doit/cmd_base.py", line 150, in parse_execute
    return self.execute(params, args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/docs/checkouts/readthedocs.org/user_builds/dpdata/conda/735/lib/python3.12/site-packages/doit/cmd_base.py", line 570, in execute
    return self._execute(**exec_params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/docs/checkouts/readthedocs.org/user_builds/dpdata/conda/735/lib/python3.12/site-packages/doit/cmd_run.py", line 265, in _execute
    return runner.run_all(self.control.task_dispatcher())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/docs/checkouts/readthedocs.org/user_builds/dpdata/conda/735/lib/python3.12/site-packages/doit/runner.py", line 254, in run_all
    self.run_tasks(task_dispatcher)
  File "/home/docs/checkouts/readthedocs.org/user_builds/dpdata/conda/735/lib/python3.12/site-packages/doit/runner.py", line 213, in run_tasks
    node = task_dispatcher.generator.send(node)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/docs/checkouts/readthedocs.org/user_builds/dpdata/conda/735/lib/python3.12/site-packages/doit/control.py", line 629, in _dispatcher_generator
    next_step = node.step()
                ^^^^^^^^^^^
  File "/home/docs/checkouts/readthedocs.org/user_builds/dpdata/conda/735/lib/python3.12/site-packages/doit/control.py", line 336, in step
    return next(self.generator)
           ^^^^^^^^^^^^^^^^^^^^
  File "/home/docs/checkouts/readthedocs.org/user_builds/dpdata/conda/735/lib/python3.12/site-packages/doit/control.py", line 345, in _func
    for value in decorated(*args, **kwargs):
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/docs/checkouts/readthedocs.org/user_builds/dpdata/conda/735/lib/python3.12/site-packages/doit/control.py", line 473, in _add_task
    new_tasks = generate_tasks(to_load, task_gen, ref.__doc__)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/docs/checkouts/readthedocs.org/user_builds/dpdata/conda/735/lib/python3.12/site-packages/doit/loader.py", line 390, in generate_tasks
    for task_dict, x_doc in flat_generator(gen_result, gen_doc):
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/docs/checkouts/readthedocs.org/user_builds/dpdata/conda/735/lib/python3.12/site-packages/doit/loader.py", line 27, in flat_generator
    for item in gen:
                ^^^
  File "/home/docs/checkouts/readthedocs.org/user_builds/dpdata/conda/735/lib/python3.12/site-packages/jupyterlite_core/manager.py", line 138, in _delayed_gather
    yield from _gather()
  File "/home/docs/checkouts/readthedocs.org/user_builds/dpdata/conda/735/lib/python3.12/site-packages/jupyterlite_core/manager.py", line 131, in _gather
    raise error
  File "/home/docs/checkouts/readthedocs.org/user_builds/dpdata/conda/735/lib/python3.12/site-packages/jupyterlite_core/manager.py", line 123, in _gather
    for task in getattr(addon, attr)(self):
                ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/docs/checkouts/readthedocs.org/user_builds/dpdata/conda/735/lib/python3.12/site-packages/jupyterlite_xeus/add_on.py", line 124, in post_build
    self.create_prefix()
  File "/home/docs/checkouts/readthedocs.org/user_builds/dpdata/conda/735/lib/python3.12/site-packages/jupyterlite_xeus/add_on.py", line 148, in create_prefix
    create_conda_env_from_env_file(root_prefix, yaml_content, env_file.parent)
  File "/home/docs/checkouts/readthedocs.org/user_builds/dpdata/conda/735/lib/python3.12/site-packages/jupyterlite_xeus/create_conda_env.py", line 55, in create_conda_env_from_env_file
    create_conda_env_from_specs(
  File "/home/docs/checkouts/readthedocs.org/user_builds/dpdata/conda/735/lib/python3.12/site-packages/jupyterlite_xeus/create_conda_env.py", line 71, in create_conda_env_from_specs
    _create_conda_env_from_specs_impl(
  File "/home/docs/checkouts/readthedocs.org/user_builds/dpdata/conda/735/lib/python3.12/site-packages/jupyterlite_xeus/create_conda_env.py", line 128, in _create_conda_env_from_specs_impl
    return _create_env_with_config(MAMBA_COMMAND, prefix_path, specs, channels_args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/docs/checkouts/readthedocs.org/user_builds/dpdata/conda/735/lib/python3.12/site-packages/jupyterlite_xeus/create_conda_env.py", line 141, in _create_env_with_config
    subprocess_run(
  File "/home/docs/checkouts/readthedocs.org/user_builds/dpdata/conda/735/lib/python3.12/subprocess.py", line 571, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/home/docs/checkouts/readthedocs.org/user_builds/dpdata/conda/735/bin/mamba', 'create', '--yes', '--prefix', PosixPath('/tmp/tmp7yjenfp5/env/envs/dpdata-emscripten'), '-c', 'https://repo.mamba.pm/emscripten-forge', '-c', 'conda-forge']' returned non-zero exit status 1.

https://github.com/jupyterlite/xeus/blob/4f43511a8f72fe40426b73ee63f2675ee59ee296/jupyterlite_xeus/create_conda_env.py#L141-L144

This module creates a directory before mamba is run, but it seems that mamba doesn't allow it?

Reproduce

See build log: https://readthedocs.org/projects/dpdata/builds/25894998/

Expected behavior

no error.

Context

njzjz commented 1 week ago

The workaround is to pin mamba<2. It seems a breaking change in mamba.

DerThorsten commented 1 week ago

The workaround is to pin mamba<2. It seems a breaking change in mamba.

@JohanMabille pinging you because this might be of interest to you