PR

OSError: libGLU.so.1: cannot open shared object file: No such file or directory

「OSError: libGLU.so.1: cannot open shared object file: No such file or directory」に対する対処法の紹介

スポンサーリンク

エラー

Ubuntuでとあるプログラムを実行しようとしたらこんなエラーが出た

:~$ python test.py
Traceback (most recent call last):
  File "/mnt/c/Users/mtkbirdman/Desktop/gmsh/test.py", line 1, in <module>
    import gmsh
  File "/mnt/c/Users/mtkbirdman/Desktop/gmsh/.gmshvenv/lib/python3.10/site-packages/gmsh.py", line 53, in <module>
    lib = CDLL(libpath)
  File "/usr/local/lib/python3.10/ctypes/__init__.py", line 374, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: libGLU.so.1: cannot open shared object file: No such file or directory

原因

必要なライブラリがインストールされていない

対処法

必要なライブラリをインストールする
https://fenicsproject.discourse.group/t/oserror-libglu-so-1/6021

sudo apt update
sudo apt upgrade -y
sudo apt-get -y install libglu1 libxcursor-dev libxft2 libxinerama1 libfltk1.3-dev libfreetype6-dev libgl1-mesa-dev libocct-foundation-dev libocct-data-exchange-dev
:~$ sudo apt update
Hit:1 http://archive.ubuntu.com/ubuntu focal InRelease
Get:2 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Get:3 http://archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
	:
Reading package lists... Done
Building dependency tree
Reading state information... Done
140 packages can be upgraded. Run 'apt list --upgradable' to see them.
:~$ sudo apt upgrade -y
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
	:
Updating certificates in /etc/ssl/certs...
0 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d...
done.
Processing triggers for dbus (1.12.16-2ubuntu2.2) ...
:~$ sudo apt-get -y install libglu1 libxcursor-dev libxft2 libxinerama1 libfltk1.3-dev libfreetype6-dev libgl1-mesa-dev libocct-foundation-dev libocct-data-exchange-dev
clearp://archive.ubuntu.com/ubuntu focal-updates/main amd64 libgl1-mesa-dev amd64 21.2.6-0ubuntu0.1~20.04.2 [6420 B]
Fetched 442 kB in 2s (201 kB/s)
Selecting previously unselected package libwayland-server0:amd64.
(Reading database ... 59120 files and directories currently installed.)
	:
Setting up libglvnd-dev:amd64 (1.3.2-1~ubuntu0.20.04.2) ...
Setting up libgl1-mesa-dev:amd64 (21.2.6-0ubuntu0.1~20.04.2) ...
Processing triggers for libc-bin (2.31-0ubuntu9.9) ...

もういちどプログラムを実行してみる

:~$ python test.py
Info    : Meshing 1D...
Info    : [  0%] Meshing curve 7 (Line)
Info    : [ 20%] Meshing curve 8 (Line)ackages.
Info    : [ 30%] Meshing curve 9 (Line)packages.
Info    : [ 50%] Meshing curve 10 (Line)packages.
Info    : [ 60%] Meshing curve 11 (Line)talled packages in requirements format.
Info    : [ 80%] Meshing curve 12 (Line)e python environment.
Info    : [ 90%] Meshing curve 13 (Line)lled packages.
Info    : Done meshing 1D (Wall 0.0046932s, CPU 0s)t installed packages.
Info    : Meshing 2D...       Verify installed packages have compatible dependencies.
Info    : [  0%] Meshing surface 16 (Transfinite)obal configuration.
Info    : [ 50%] Meshing surface 17 (Plane, Frontal-Delaunay)
Info    : [ 50%] Blossom: 352 internal 40 closed pip's wheel cache.
Info    : [ 50%] Blossom recombination completed (Wall 0.0037343s, CPU 0s): 123 quads, 0 triangles, 0 invalid quads, 0 quads with Q < 0.1, avg Q = 0.794079, min Q = 0.539211
Info    : Done meshing 2D (Wall 0.0127389s, CPU 0.015625s)rements.
Info    : Meshing 3D...       Compute hashes of package archives.
Info    : Done meshing 3D (Wall 4.5e-05s, CPU 0s)ed for command completion.
Info    : 254 nodes 299 elementsow information useful for debugging.
Info    : Writing 'test.msh'...how help for commands.
Info    : Done writing 'test.msh'
gmsh > done!

できた

以上

コメント