Installing 2.0a8 in a venv environment

Hi all, I was using acondainstallation of FESTIM 2.0a8 for a while, but the package with which I use FESTIM now supports only venv virtual environments. (I am doing UQ for FESTIM, which underneath runs many parametrised instances of the code in a single resource allocation governed by a pilot job mechanism.)

I see that the FESTIM 2.0 toml file requires scifem>=0.2.13 version, however, it seems that scifem cannot recognise the FEniCSx installation done via apt, like it is written here.

If I am installing scifem arbitrarily, via pip install scifem, pip will go down to the scifem-0.1.0 version. If I am trying to install a specific >=0.2 version, it will fail due to an unfound dependency:

ERROR: Could not find a version that satisfies the requirement fenics-dolfinx (from versions: none)
ERROR: No matching distribution found for fenics-dolfinx

Installing FESTIM from pip via pip install FESTIM==2.0a8 into a fresh venv environment would break at the scifem installation stage, due to none of its versions finding its dependencies:

INFO: pip is still looking at multiple versions of scifem to determine which version is compatible with other requirements. This could take a while.
ERROR: Cannot install FESTIM because these package versions have conflicting dependencies.

The conflict is caused by:
scifem 0.7.0 depends on fenics-dolfinx
scifem 0.6.0 depends on fenics-dolfinx
scifem 0.5.0 depends on fenics-dolfinx
scifem 0.4.0 depends on fenics-dolfinx
scifem 0.3.1 depends on fenics-dolfinx
scifem 0.3.0 depends on fenics-dolfinx
scifem 0.2.14 depends on fenics-dolfinx
scifem 0.2.13 depends on fenics-dolfinx

Running things in a Docker container is also an option for me, however, the installation via Docker does not seem to work, probably because FEniCS removed the image labelled as stable from the repository.

Has anyone encountered issues with installing the right scifem version? What would be the safest way of installing FESTIM 2.0.x dependencies without using conda?

Hi @YehorYudin

Do you mind providing all the steps (ie. first run this command, then run this command…) to reproduce your issue? It will greatly help in assisting you!

I don’t understand this. Can you share what package this is?

@YehorYudin I also don’t understand how a package can only support venv. venv is not a package manager.

You also have the option to use both conda and venv, but my guess is your package is available on pypi and can be installed with pip

Hi James, thanks for getting back so quickly!

I was referring to the current standard built-in Python 3 package for virtual environments:

docs.python.org/3/library/venv.html

If someone can tell if the following three lines can work as a valid installation set-up for the latest (2.0.a8) version, that would be appreciated!:

python3 -m venv festim2-venv-test

source festim2-venv-test/bin/activate

python3 -m pip install festim==2.0.a8

I am encountering an issue with the scifem installation on this stage:

INFO: pip is still looking at multiple versions of scifem to determine which version is compatible with other requirements. This could take a while.
ERROR: Cannot install festim because these package versions have conflicting dependencies.

The conflict is caused by:
scifem 0.7.0 depends on fenics-dolfinx
scifem 0.6.0 depends on fenics-dolfinx
scifem 0.5.0 depends on fenics-dolfinx
scifem 0.4.0 depends on fenics-dolfinx
scifem 0.3.1 depends on fenics-dolfinx
scifem 0.3.0 depends on fenics-dolfinx
scifem 0.2.14 depends on fenics-dolfinx
scifem 0.2.13 depends on fenics-dolfinx

1 Like

You mention a package which only supports venv do you mind sharing what this package is?

This alone will not install dolfinx properly (only the python bindings, you need all the C++ stuff that is not distributed via pypi).

I confirm that the following doesn’t work because you cannot mix apt and pip as they are completely different pacakge managers:

python3 -m venv festim2-venv-test
source festim2-venv-test/bin/activate

add-apt-repository ppa:fenics-packages/fenics
apt update
apt install fenicsx


python3 -m pip install festim==2.0.a8

If the issue is related to scifem then maybe this question is best posted there where the scifem maintainers will help.

Again, if you share what UQ package you are using maybe we can help finding a solution for this.

@YehorYudin after chatting with @jorgendokken, if you have to use venv then you have to build dolfinx from source. Which isn’t convenient at all.

venv is used in the FEniCS docker images btw.

I would use a fenics docker image and then install festim in there

Thank you for your suggestions, and sorry for not replying for a while!

I am using EasyVVUQ for uncertainty quantification of a simple FESTIM model.

This is a non-intrusive approach, so it needs to run multiple instances of the same executable for different inputs, on a particular resource allocation. Here, I went for simply making a Python interpreter as the executable, which runs a script constructing and running a FESTIM model. I had a hard time setting up the workflow such that the software piece managing the multiple instances can specify the right environment for Python running FESTIM2.0.x

So far, it works locally with a conda environment. To do that, I resolved some local issues, though. We have a list of HPC resources available, and I am not sure, however, that we will not have issues with a virtual environment set-up on some of he local clusters later.

I would like to try running it in a docker, as FEniCSX has existing images posted, and the UQ software supports docker containerisation of the codes being run, but would depend on what whether it would be both reasonable and feasible on an HPC like ARCHER2.

But at the moment, I have no issues with working with FESTIM further. Thank you all for a prompt reaction!

Glad it now works! I see that easyvvuq is available via pip, so you should be able to just pip install it in a conda environment. no?

When it comes to HPC, conda isn’t really suitable for performance reasons.

I think you’d have to either/or:

  • build dolfinx from source
  • install dolfinx with spack or singularity (package managers better suited for HPC architectures)

We could also work on making a spack distribution for FESTIM. Feel free to open an issue for this!