Mybinder (and binderhub) fails for conda environment.yml containing python dependency

Hi!

I have been hitting issues using binderhub to launch conda environments via an environment.yml file. To debug I created a minimal Gist containing the environment file and also tried this on mybinder.org and I see the same failures there.

The Gist is: conda env with python · GitHub

and binderhub (conda?) fails with the following error

# >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<

    Traceback (most recent call last):
      File "/srv/conda/lib/python3.11/site-packages/conda/exception_handler.py", line 16, in __call__
        return func(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^
      File "/srv/conda/lib/python3.11/site-packages/conda_env/cli/main.py", line 49, in do_call
        exit_code = getattr(module, func_name)(args, parser)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/srv/conda/lib/python3.11/site-packages/conda/notices/core.py", line 123, in wrapper
        return func(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^
      File "/srv/conda/lib/python3.11/site-packages/conda_env/cli/main_update.py", line 139, in execute
        result[installer_type] = installer.install(prefix, specs, args, env)
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/srv/conda/lib/python3.11/site-packages/mamba/mamba_env.py", line 153, in mamba_install
        transaction.fetch_extract_packages()
    RuntimeError: Could not set URL (code: 14 - url = /wheel-0.40.0-pyhd8ed1ab_0.conda)

`$ /srv/conda/bin/mamba update -p /srv/conda/envs/notebook --file environment.yml`

  environment variables:
                 CIO_TEST=<not set>
  CONDA_AUTO_UPDATE_CONDA=false
        CONDA_DEFAULT_ENV=/srv/conda/envs/notebook
                CONDA_DIR=/srv/conda
           CONDA_PLATFORM=linux-64
               CONDA_ROOT=/srv/conda
           CURL_CA_BUNDLE=<not set>
               LD_PRELOAD=<not set>
                     PATH=/home/jovyan/.local/bin:/home/jovyan/.local/bin:/srv/conda/envs/notebo
                          ok/bin:/srv/conda/bin:/srv/npm/bin:/usr/local/sbin:/usr/local/bin:/usr
                          /sbin:/usr/bin:/sbin:/bin
       REQUESTS_CA_BUNDLE=<not set>
            SSL_CERT_FILE=<not set>

     active environment : None
       user config file : /home/jovyan/.condarc
 populated config files : /srv/conda/.condarc
          conda version : 23.5.2
    conda-build version : not installed
         python version : 3.11.6.final.0
       virtual packages : __archspec=1=x86_64
                          __glibc=2.27=0
                          __linux=5.15.0=0
                          __unix=0=0
       base environment : /srv/conda  (writable)
      conda av data dir : /srv/conda/etc/conda
  conda av metadata url : None
           channel URLs : https://conda.anaconda.org/conda-forge/linux-64
                          https://conda.anaconda.org/conda-forge/noarch
                          https://repo.anaconda.com/pkgs/main/linux-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/linux-64
                          https://repo.anaconda.com/pkgs/r/noarch
          package cache : /srv/conda/pkgs
                          /home/jovyan/.conda/pkgs
       envs directories : /srv/conda/envs
                          /home/jovyan/.conda/envs
               platform : linux-64
             user-agent : conda/23.5.2 requests/2.31.0 CPython/3.11.6 Linux/5.15.0-79-generic ubuntu/18.04.6 glibc/2.27
                UID:GID : 1000:1000
             netrc file : None
           offline mode : False


An unexpected error has occurred. Conda has prepared the above report.

Note that the exact same environment file successfully creates an environment locally (python 3.9.15, conda 23.9.0)

I am wondering if this is a known issue? if it is binderhub related (I can reproduce on a different, recently deployed, binderhub instance too) or conda related?

I can get an (this) environment.yml working on mybinder.org by removing the python dependency.

[from the error trace] I note that python 3.11 is already the base python installed, I’m assuming that any python>=3.x would/should just be ignored normally?

Best
Steve

1 Like

It had been discussed over in this thread, especially see the end. I don’t know though if the issue referenced in the thread was updated to include this or if there’s a separate one already filed?

2 Likes

The latest version of repo2docker includes an upgrade of mamba (not yet deployed to mybinder). If you have time it might be worth installing repo2docker from the main branch locally and seeing if that helps.

1 Like