Trouble Installing FEniCS on Ubuntu

I’m running the most recent LTS release of Ubuntu as of Jan. 2024.

When I enter the following two commands

conda create -n fenicsx-env
conda activate fenicsx-env
conda install -c conda-forge fenics-dolfinx mpich pyvista

in the command line, the first two are executed without problem. However, when I try to execute the third, the following is printed to console,

Collecting package metadata (current_repodata.json): done
Solving environment: unsuccessful initial attempt using frozen solve. Retrying with flexible solve.
Solving environment: unsuccessful attempt using repodata from current_repodata.json, retrying with next repodata source.

this happens repeatedly without resolution. Any idea of where to go from here?

I cannot reproduce this with the minimal docker file

FROM ubuntu:22.04

WORKDIR /src

ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
    apt-get install -y libgl1-mesa-glx libegl1-mesa libxrandr2 libxrandr2 libxss1 libxcursor1 libxcomposite1 libasound2 libxi6 libxtst6 curl

RUN curl -O https://repo.anaconda.com/archive/Anaconda3-2023.09-0-Linux-x86_64.sh
RUN bash ./Anaconda3-2023.09-0-Linux-x86_64.sh  -b -p /miniconda
ENV PATH=/miniconda/bin:${PATH}
RUN conda update -y conda
RUN conda init bash && \
    . ~/.bashrc  && \
    conda create -n fenicsx-env && \
    conda activate fenicsx-env && \ 
    conda install -c conda-forge fenics-dolfinx mpich pyvista && \
    python3 -c "import mpi4py; import dolfinx; print(dolfinx.__version__)"

So you would have to give us some more information about your build-system.
What kind of machine are you running on.
Are you running under WSL or something similar?
Do you have arm or amd processors?

>What kind of machine are you running on.
The machine I’m using is a Lenovo ThinkPad T14s Gen 2a

>Are you running under WSL or something similar?
No, I’m running ubuntu natively

>Do you have arm or amd processors?
I have AMD processors

What happens if you run the docker script above on your system?

I was able to get around this by installing the libmamba solver for conda. Perhaps this is inadvisable but it did work.

glad you were able to get it to work. If you run into further trouble, when debugging conda issues, it helps to include the output of conda info, and if it’s an existing env where things aren’t working, conda env export as well.

1 Like