xeus-python-demo icon indicating copy to clipboard operation
xeus-python-demo copied to clipboard

Cannot build xeus-python-demo

Open nthiery opened this issue 10 months ago • 3 comments

Description

xeus-python-demo won't build. I first encountered this on a jupyter lite instance of mine. It presumably is related to the version of conda/mamba.

Reproduce

  1. Install a fresh miniforge3
  2. Install mamba
  3. Create build environment with mamba env create -f build-environment.yml
  4. Switch to build environment with mamba activate build-env
  5. Run jupyter-lite build --contents content --output-dir dist

Got

RuntimeError: Failed to create the virtual environment for xeus-python,
        please make sure at least mamba, micromamba or conda is installed.
Full log
jupyter-lite build --contents content --output-dir dist
static:jupyter-lite.json
.  pre_status:static:jupyter-lite.json
    tarball:         jupyterlite-app-0.5.0.tgz 14MB
    output:          /opt/xeus-python-demo/dist
    lite dir:        /opt/xeus-python-demo
    apps:            
    sourcemaps:      True
    unused packages: True
archive:archive
contents:contents
icons:icons
lite:jupyter-lite.json
mimetypes:jupyter-lite.json
serve:contents
settings:overrides
translation:translation
.  status:archive:archive
[LiteBuildApp] No archive (yet): xeus-python-demo-jupyterlite.tgz
.  status:contents:contents
    contents: 2 files
.  status:icons:icons
    favicon files: 7 files
.  status:lite:jupyter-lite.json
[LiteBuildApp]     jupyter-lite.(json|ipynb): 0 files
.  status:mimetypes:jupyter-lite.json
    filetypes:         26 
.  status:serve:contents
    url: http://127.0.0.1:8000/
    server: tornado
    headers:
.  status:settings:overrides
    overrides.json: 0
.  status:translation:translation
    translation files: 2 files
static:output_dir
-- pre_init:static:output_dir
static:unpack
-- init:static:unpack
federated_extensions:copy:ext:jupyterlab_pygments
federated_extensions:copy:ext:@jupyterlite/xeus-extension
-- pre_build:federated_extensions:copy:ext:jupyterlab_pygments
-- pre_build:federated_extensions:copy:ext:@jupyterlite/xeus-extension
contents:copy:README.md
contents:copy:demo.ipynb
icons:copy
/opt/miniforge3/envs/build-env/lib/python3.13/site-packages/jupyterlite_core/addons/translation.py:89: UserWarning: [lite] [translation] install `jupyterlab_server` to load translations: No module named 'jupyterlab_server'
  if not self.is_sys_prefix_ignored() and has_optional_dependency(
translation:copy
-- build:contents:copy:README.md
-- build:contents:copy:demo.ipynb
.  build:icons:copy
-- build:translation:copy
contents:contents:.
federated_extensions:patch
federated_extensions:settings
[LiteBuildApp] ERROR | [lite] [post_build] [jupyterlite-xeus] [ERR] Failed to create the virtual environment for xeus-python,
        please make sure at least mamba, micromamba or conda is installed.

Traceback (most recent call last): File "/opt/miniforge3/envs/build-env/lib/python3.13/site-packages/doit/doit_cmd.py", line 294, in run return command.parse_execute(args) ~~~~~~~~~~~~~~~~~~~~~^^^^^^ File "/opt/miniforge3/envs/build-env/lib/python3.13/site-packages/doit/cmd_base.py", line 150, in parse_execute return self.execute(params, args) ~~~~~~~~~~~~^^^^^^^^^^^^^^ File "/opt/miniforge3/envs/build-env/lib/python3.13/site-packages/doit/cmd_base.py", line 570, in execute return self._execute(**exec_params) ~~~~~~~~~~~~~^^^^^^^^^^^^^^^ File "/opt/miniforge3/envs/build-env/lib/python3.13/site-packages/doit/cmd_run.py", line 265, in _execute return runner.run_all(self.control.task_dispatcher()) ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/miniforge3/envs/build-env/lib/python3.13/site-packages/doit/runner.py", line 254, in run_all self.run_tasks(task_dispatcher) ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^ File "/opt/miniforge3/envs/build-env/lib/python3.13/site-packages/doit/runner.py", line 213, in run_tasks node = task_dispatcher.generator.send(node) File "/opt/miniforge3/envs/build-env/lib/python3.13/site-packages/doit/control.py", line 629, in _dispatcher_generator next_step = node.step() File "/opt/miniforge3/envs/build-env/lib/python3.13/site-packages/doit/control.py", line 336, in step return next(self.generator) File "/opt/miniforge3/envs/build-env/lib/python3.13/site-packages/doit/control.py", line 345, in _func for value in decorated(*args, **kwargs): ~~~~~~~~~^^^^^^^^^^^^^^^^^ File "/opt/miniforge3/envs/build-env/lib/python3.13/site-packages/doit/control.py", line 473, in _add_task new_tasks = generate_tasks(to_load, task_gen, ref.doc) File "/opt/miniforge3/envs/build-env/lib/python3.13/site-packages/doit/loader.py", line 390, in generate_tasks for task_dict, x_doc in flat_generator(gen_result, gen_doc): ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^ File "/opt/miniforge3/envs/build-env/lib/python3.13/site-packages/doit/loader.py", line 27, in flat_generator for item in gen: ^^^ File "/opt/miniforge3/envs/build-env/lib/python3.13/site-packages/jupyterlite_core/manager.py", line 138, in _delayed_gather yield from _gather() File "/opt/miniforge3/envs/build-env/lib/python3.13/site-packages/jupyterlite_core/manager.py", line 131, in _gather raise error File "/opt/miniforge3/envs/build-env/lib/python3.13/site-packages/jupyterlite_core/manager.py", line 123, in _gather for task in getattr(addon, attr)(self): ~~~~~~~~~~~~~~~~~~~~^^^^^^ File "/opt/miniforge3/envs/build-env/lib/python3.13/site-packages/jupyterlite_xeus/add_on.py", line 138, in post_build self.create_prefix() ~~~~~~~~~~~~~~~~~~^^ File "/opt/miniforge3/envs/build-env/lib/python3.13/site-packages/jupyterlite_xeus/add_on.py", line 162, in create_prefix create_conda_env_from_env_file(root_prefix, yaml_content, env_file.parent) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/miniforge3/envs/build-env/lib/python3.13/site-packages/jupyterlite_xeus/create_conda_env.py", line 53, in create_conda_env_from_env_file create_conda_env_from_specs( ~~~~~~~~~~~~~~~~~~~~~~~~~~~^ env_name=env_name, ^^^^^^^^^^^^^^^^^^ ...<3 lines>... pip_dependencies=pip_dependencies, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ) ^ File "/opt/miniforge3/envs/build-env/lib/python3.13/site-packages/jupyterlite_xeus/create_conda_env.py", line 69, in create_conda_env_from_specs _create_conda_env_from_specs_impl( ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ env_name=env_name, ^^^^^^^^^^^^^^^^^^ ...<2 lines>... channels=channels, ^^^^^^^^^^^^^^^^^^ ) ^ File "/opt/miniforge3/envs/build-env/lib/python3.13/site-packages/jupyterlite_xeus/create_conda_env.py", line 131, in _create_conda_env_from_specs_impl raise RuntimeError( ...<3 lines>... ) RuntimeError: Failed to create the virtual environment for xeus-python, please make sure at least mamba, micromamba or conda is installed.

Expected behavior

A smooth run

Context

  • JupyterLite version:
(build-env) ➜  xeus-python-demo git:(main) ✗ mamba --version
2.0.5
(build-env) ➜  xeus-python-demo git:(main) ✗ conda --version
conda 25.1.0
(build-env) ➜  xeus-python-demo git:(main) ✗ mamba list | grep jupyterlite
  jupyterlite-core               0.5.0           pyh885dcc9_0        conda-forge
  jupyterlite-xeus               3.1.1           pyhd8ed1ab_0        conda-forge
  • Operating System and version: Linux ubuntu 24.10
  • Browser and version: firefox; but not used anyway

nthiery avatar Jan 27 '25 22:01 nthiery

Thanks for opening an issue.

This is weird. Can you try installing micromamba from conda-forge into build-env?

martinRenou avatar Jan 29 '25 08:01 martinRenou

Ah ah, good catch. Thanks for the tip. That worked :-)

Should micromamba be added to build-environment.yml? Or should it work with just conda/mamba?

nthiery avatar Jan 29 '25 21:01 nthiery

It is supposed to work with just conda/mamba, although we've seen some issues with them.

We're thinking of dropping support for them and simply depend on micromamba https://github.com/jupyterlite/xeus/issues/148

martinRenou avatar Jan 30 '25 08:01 martinRenou