gimli-org / gimli

Geophysical Inversion and Modeling Library :earth_africa:
https://www.pygimli.org
Other
364 stars 133 forks source link

how to fix import pygimli error libcholmod.so.3 on Mybinder #722

Open stefanazzz opened 3 months ago

stefanazzz commented 3 months ago

Problem description

When trying to run from my Github repository using MyBinder, import pygimli gives the following error:

"libcholmod.so.3: cannot open shared object file: No such file or directory (...)"

This can be fixed by adding python=3.8 to the yml environment file (see file below)

Your environment

from environment.yml file on github:

channels:
  - conda-forge
  - gimli
  - defaults
dependencies:
  - python=3.8          <-- add this line to make "import pygimli" work correctly
  - pygimli>=1.1.0

Notes

I suppose that 1.1.0 is compatible only with 3.8 not more recent versions. Note that pygimli >=1.5.0 shows the same problem when compiled with the current (May 2024) default mybinder python 3.11.x. I tried a few combinations but so far only 1.1.0 and 3.8 seem to work on mybinder.

halbmy commented 3 months ago

Can you try using pip install pygimli instead?

stefanazzz commented 3 months ago

Yes Thomas, I will try that too and let you know

On Mon, 20 May 2024 at 22:12, Thomas Günther @.***> wrote:

Can you try using pip install pygimli instead?

— Reply to this email directly, view it on GitHub https://github.com/gimli-org/gimli/issues/722#issuecomment-2121215175, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKX4DUTOFK64XKTP6QXQMITZDJRKNAVCNFSM6AAAAABH745DUGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMRRGIYTKMJXGU . You are receiving this because you authored the thread.Message ID: @.***>

ruboerner commented 3 months ago

Is https://github.com/gimli-org/gimli/issues/721#issuecomment-2126343717 probably related?

stefanazzz commented 3 months ago

yes, using pip in the environment.yml file also works (rather than downgrading to python 3.8):

channels:

On Mon, May 20, 2024 at 10:12 PM Thomas Günther @.***> wrote:

Can you try using pip install pygimli instead?

— Reply to this email directly, view it on GitHub https://github.com/gimli-org/gimli/issues/722#issuecomment-2121215175, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKX4DUTOFK64XKTP6QXQMITZDJRKNAVCNFSM6AAAAABH745DUGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMRRGIYTKMJXGU . You are receiving this because you authored the thread.Message ID: @.***>

stefanazzz commented 3 months ago

to reply to Ralph-Uwe, possibly related, but I would not know how to implement the symbolic links on github/mybinder

On Thu, May 23, 2024 at 7:42 AM Ralph-Uwe Börner @.***> wrote:

Is #721 (comment) https://github.com/gimli-org/gimli/issues/721#issuecomment-2126343717 probably related?

— Reply to this email directly, view it on GitHub https://github.com/gimli-org/gimli/issues/722#issuecomment-2126346483, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKX4DUUJ7TLDDIYSZ2R6CQ3ZDWFTTAVCNFSM6AAAAABH745DUGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMRWGM2DMNBYGM . You are receiving this because you authored the thread.Message ID: @.***>

prisae commented 2 months ago

Just to mention it here too: The same happens on Github Actions: While conda install -c gimli pygimli does work, loading pygimli results in

ImportError: libcholmod.so.3: cannot open shared object file: No such file or directory
prisae commented 2 months ago

I just got hit by this even on my local machine (Ubuntu 22.04.4) with Python 3.11.

carsten-forty2 commented 2 months ago

For win and linux and py310, py311 you can try pip install pygimli which may help. However, the pgcore package which comes with the pip installation is not compatible with the current master and dev branch. If you want to use git sources with the pgcore from pip, you need to switch to the wheel branch which should not far away from dev and will be rebased to the new dev after some more tests.

prisae commented 2 months ago

Cool, thanks, that works for now!

prisae commented 3 days ago

This was marked as completed, but I keep running into this issue also with pyGIMLi 1.5.2, when using conda. When using pip, pyGIMLi installs a s..tload of stuff, basically re-building my entire environment, and subsequently fails of dependency issues.

Nothing urgent, but I think something still to keep an eye on...?

halbmy commented 3 days ago

You're completely right, we should leave this issue open until it is solved properly and not only a hack mixing conda and pip. As the dependency is with pgcore and not pyGIMLi, we will solve it only with pyGIMLi v1.6, i.e. a core update.

prisae commented 2 days ago

This time this suggestion made it possible (thanks @halbmy):

conda create -n pg -c gimli -c conda-forge "pygimli>=1.5.0" python=3.10 suitesparse=5

(the suitesparse=5-bit).