fenics-adapter icon indicating copy to clipboard operation
fenics-adapter copied to clipboard

Installing fenics adapter may break FEniCS installation

Open BenjaminRodenberg opened this issue 4 years ago • 8 comments

See https://fenicsproject.discourse.group/t/installing-python-package-with-fenics-dependency-breaks-fenics-installation/4476.

To me this looks like an upstream issue. The fenics adapter depends on fenics. Therefore the following dependencies in setup.py look correct:

https://github.com/precice/fenics-adapter/blob/fcd3f0c50b030b35cbea54b278d7c015a67447cd/setup.py#L28

However, if we assume a user has already fixed the FEniCS installation by manually uninstalling fenics-ufl, the fenics adapter will reinstall fenics-ufl due to the fenics dependency and (again) break the FEniCS installation. The user has to uninstall fenics-ufl (again) after installing the fenics adapter.

A possible solution that I have in mind is to declare FEniCS as a dependency of the adapter, but avoid reinstalling fenics-ufl. Is this possible?

BenjaminRodenberg avatar Nov 10 '20 16:11 BenjaminRodenberg

This is a sporadic issue. We will keep it open as an information for users, but won't fix it until we can reproduce it.

BenjaminRodenberg avatar Dec 10 '20 17:12 BenjaminRodenberg

I guess we can reproduce the problem with this docker file: https://github.com/uekerman/Coupled-Brittle-Fracture/blob/master/brittle-fracture.dockerfile

uekerman avatar Dec 11 '20 11:12 uekerman

The Dockerfile from https://fenicsproject.discourse.group/t/installing-python-package-with-fenics-dependency-breaks-fenics-installation/4476 allows us to reproduce the error. I think this is a upstream issue, where we currently cannot do anything.

BenjaminRodenberg avatar Dec 20 '20 23:12 BenjaminRodenberg

From my understanding, fenics is a pure meta package, which simply depends on all major modules.

Hence, import * from fencis shouldn't work as there is no fenics module. In fact, the module is not importable when installed in a venv.

My best guess is that the FEniCS tutorials are out of date and one should import the modules directly:

import ufl, dijitso, FIAT, ffc

This modified Dockerfile should illustrate this issue.

fsimonis avatar Jan 26 '21 09:01 fsimonis

For pip noobs (like me), the workaround is:

pip3 uninstall -y fenics-ufl

uekerman avatar Mar 16 '21 10:03 uekerman

Another alternative is to do the following:

pip3 install --no-deps fenicsadapter

As far as I understand the broken fenics-ufl is installed due to fenics dependency.

BenjaminRodenberg avatar Mar 26 '21 19:03 BenjaminRodenberg

Another alternative is to do the following:

pip3 install --no-deps fenicsadapter

Should not be pip3 install --no-deps fenicsprecice ? Do we still support the older name?

IshaanDesai avatar Mar 29 '21 06:03 IshaanDesai

Reopening this issue with the same rationale as for #154: Would be nice to avoid this problem trough technical means and a proper dependency handling.

BenjaminRodenberg avatar Oct 11 '23 11:10 BenjaminRodenberg