Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
tomsail opened this issue Oct 19, 2023 · 6 comments
Closed

Comments

@tomsail
Copy link
Collaborator

tomsail commented Oct 19, 2023

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
Copy link
Collaborator

pmav99 commented Oct 19, 2023

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
Copy link
Collaborator Author

tomsail commented Oct 19, 2023

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

@tomsail
Copy link
Collaborator Author

tomsail commented Oct 19, 2023

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
Copy link
Collaborator

pmav99 commented Oct 29, 2023

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

@brey
Copy link
Collaborator

brey commented Nov 7, 2023

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

@tomsail
Copy link
Collaborator Author

tomsail commented Nov 7, 2023

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

@tomsail tomsail closed this as completed Nov 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants