Open RemDelaporteMathurin opened 1 year ago
@jhdark
This is an error initializing mamba, so definitely a failed install of mamba and/or conda (specifically, mamba was installed but a compatible libarchive dependency is not installed). So it's the conda install mamba
line that fails, but the second line is where the error occurs. I imagine you'd see this same error with mamba install <anything>
.
This dockerfile also fails with the same error:
FROM mcr.microsoft.com/vscode/devcontainers/miniconda:0-3
RUN conda install -c conda-forge mamba
RUN mamba install -c conda-forge mamba # should be a no-op
My guess is it's the mixing of conda-forge
and defaults
channels that results from installing a single package form conda-forge when everything else has come from defaults. Try adding conda upgrade -c conda-forge --all
before the conda install mamba
step.
Hey @minrk , I tried adding the conda upgrade -c conda-forge --all
but doesn't seem to fix the issue. However, there is an error that comes after the RUN conda install -c conda-forge mamba
line which is:
Error while loading conda entry point: conda-libmamba-solver (libarchive.so.13: cannot open shared object file: No such file or directory)
I tried installing this package manually with RUN conda install conda-libmamba-solver
, but this didn't help either. Not sure if this helps narrow down the issue. I understand this has nothing to do with fenics, but if you have any other suggestions to try that would be great
Sorry, you need --strict-channel-prioirity
to trade out all of the defaults
packages for conda-forge
ones:
FROM mcr.microsoft.com/vscode/devcontainers/miniconda:0-3
RUN conda upgrade --strict-channel-priority -c conda-forge --all
RUN conda install -c conda-forge conda mamba
RUN mamba install -c conda-forge fenics
But even that doesn't result in a working mamba, which I don't really understand, since it's now failing with:
0.548 File "/opt/conda/lib/python3.11/site-packages/mamba/mamba.py", line 877, in _wrapped_main
0.548 configure_parser_repoquery(p._subparsers._group_actions[0])
0.548 File "/opt/conda/lib/python3.11/site-packages/mamba/mamba.py", line 805, in configure_parser_repoquery
0.548 p = sub_parsers.add_parser(
0.548 ^^^^^^^^^^^^^^^^^^^^^^^
0.548 File "/opt/conda/lib/python3.11/argparse.py", line 1192, in add_parser
0.548 raise ArgumentError(self, _('conflicting subparser: %s') % name)
0.548 argparse.ArgumentError: argument COMMAND: conflicting subparser: repoquery
which I think means that conda and/or mamba have not actually been installed properly.
Downgrading conda to 22.x resolves the issue, I don't understand why, because when I install the same versions that don't work in an isolated env, I can't reproduce the problem. So you can pin that for now:
FROM mcr.microsoft.com/vscode/devcontainers/miniconda:0-3
RUN conda upgrade --strict-channel-priority -c conda-forge --all
RUN conda install -c conda-forge conda==22.* mamba
RUN mamba install -c conda-forge fenics
Essentially, what this is doing is removing all conda packages and replacing them with ones from conda-forge, so you might be better off using a lighter base image and installing miniforge, since that should avoid having the unused files from the original miniconda install (which is all of them) in the image layer history.
fwiw, I found that it's a very recent regression in conda-libmamba-solver: https://github.com/conda/conda-libmamba-solver/issues/303, so that's what should be pinned back, not conda itself:
FROM mcr.microsoft.com/vscode/devcontainers/miniconda:0-3
RUN conda upgrade --strict-channel-priority -c conda-forge --all
RUN conda install -c conda-forge 'conda-libmamba-solver<23.9' mamba
RUN mamba install -y -c conda-forge fenics
Ok this is brilliant, it works now! thank you so much
@minrk there is some more explanation here https://github.com/conda/conda/issues/13148#issuecomment-1735930256
Solution to issue cannot be found in the documentation.
Issue
Recently, when trying to install fenics with
or
We get the following error:
Our Dockerfile is:
Installed packages
Environment info