fenics-adapter
fenics-adapter copied to clipboard
Installing fenics adapter may break FEniCS installation
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?
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.
I guess we can reproduce the problem with this docker file: https://github.com/uekerman/Coupled-Brittle-Fracture/blob/master/brittle-fracture.dockerfile
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.
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.
For pip noobs (like me), the workaround is:
pip3 uninstall -y fenics-ufl
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.
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?
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.