precice / fenics-adapter

preCICE-adapter for the open source computing platform FEniCS
GNU Lesser General Public License v3.0
29 stars 15 forks source link

Installing fenics adapter may break FEniCS installation #103

Open BenjaminRodenberg opened 3 years ago

BenjaminRodenberg commented 3 years ago

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 commented 3 years ago

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.

uekerman commented 3 years ago

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

BenjaminRodenberg commented 3 years ago

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.

fsimonis commented 3 years ago

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.

uekerman commented 3 years ago

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

pip3 uninstall -y fenics-ufl
BenjaminRodenberg commented 3 years ago

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.

IshaanDesai commented 3 years ago

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?

BenjaminRodenberg commented 12 months ago

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.