ec-jrc / pyPoseidon

Framework for Hydrodynamic simulations
https://pyposeidon.readthedocs.io/
European Union Public License 1.2
20 stars 7 forks source link

OSError: libGL.so.1: cannot open shared object file: No such file or directory #169

Closed tomsail closed 8 months ago

tomsail commented 9 months ago

My Linux env:

NAME="Ubuntu"
VERSION="20.04.3 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.3 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
(base) saillth@55932b8da2de:~/work/python/pyPoseidon$ mamba env update -n pos-dev --file environments/binary-p3.10.yml

libGL.so.1 is loaded my GMSH's API:

Python 3.10.12 | packaged by conda-forge | (main, Jun 23 2023, 22:40:32) [GCC 12.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyposeidon
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/saillth/work/python/pyPoseidon/pyposeidon/__init__.py", line 6, in <module>
    from .d3d import d3d
  File "/home/saillth/work/python/pyPoseidon/pyposeidon/d3d.py", line 28, in <module>
    import pyposeidon.mesh as pmesh
  File "/home/saillth/work/python/pyPoseidon/pyposeidon/mesh.py", line 22, in <module>
    from . import mgmsh
  File "/home/saillth/work/python/pyPoseidon/pyposeidon/mgmsh.py", line 18, in <module>
    import gmsh
  File "/home/saillth/conda/envs/pos-dev/lib/python3.10/site-packages/gmsh.py", line 86, in <module>
    lib = CDLL(libpath)
  File "/home/saillth/conda/envs/pos-dev/lib/python3.10/ctypes/__init__.py", line 374, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: libGL.so.1: cannot open shared object file: No such file or directory

steps to replicate:

 mamba create -n pos-dev
 mamba env update -n pos-dev --file environments/binary-p3.10.yml
 pip install -U -e . 

or

pip install git+https://github.com/ec-jrc/pyPoseidon.git

then

python
import pyposeidon
pmav99 commented 9 months ago

Chances are that we need to add an extra package on the conda environment. Can you try installing https://anaconda.org/conda-forge/libglu ?

tomsail commented 9 months ago

tried it, this is for libGLU.so.1, which was also missing

tomsail commented 9 months ago

This was an element of answer https://stackoverflow.com/questions/55313610/importerror-libgl-so-1-cannot-open-shared-object-file-no-such-file-or-directo but couldn't find the conda packages that deliver it, especially libgl1

pmav99 commented 9 months ago

Perhaps you can try installing one of the conda packages for mesa.

brey commented 8 months ago

@tomsail We used libgl1-mesa-glx in the binder configuration. Try to apt install it.

tomsail commented 8 months ago

Just checked. I am not able to replicate this error anymore (this was on BDAP). Maybe this was fixed during the last PR #134 Anyway, I would recommend to first create an environment from the binaries

 mamba create -n pos-dev
 mamba env update -n pos-dev --file environments/binary-p3.10.yml

and then build the library with poetry: poetry add git+https://github.com/ec-jrc/pyPoseidon.git

I will close this issue