Hi, I have followed the instructions for fenics on Docker. But when I was trying to run my host python code, it came up with the following error:
OSError Traceback (most recent call last)
2 from efit import efit
3 import matplotlib.pyplot as plt
----> 4 from mesh.plasmah_mesh_with_down_divertor import *
5 from plasmah.poisson import *
6 import os
----> 1 import gmsh
2 import sys
4 class PlasamHMesh:
5 def init(self, efit):
38 libpath = find_library(“gmsh”)
—> 40 lib = CDLL(libpath)
42 use_numpy = False
/usr/lib/python3.6/ctypes/init.py in init(self, name, mode, handle, use_errno, use_last_error)
347 if handle is None:
→ 348 self._handle = _dlopen(self._name, mode)
350 self._handle = handle
OSError: libGLU.so.1: cannot open shared object file: No such file or directory
Is there anyone who can help me with this problem? Thank you in advance.
Gmsh requires some Extra packages you can install in your container.
apt-get -y install \
You might need to add a
sudo ahead of
thank you! But it seems some other errors:
root@ad1a7e795d62:~# apt-get -y install libglu1 libxcursor-dev libxft2 libxinerama1 libfltk1.3-dev libfreetype6-dev libgl1-mesa-dev libocct-foundation-dev libocct-data-exchange-dev
Reading package lists… Done
Building dependency tree
Reading state information… Done
Note, selecting ‘libglu1-mesa’ instead of ‘libglu1’
E: Unable to locate package libocct-foundation-dev
E: Unable to locate package libocct-data-exchange-dev
Anyway, thank you again
You do not need
libocct-foundation-dev libocct-data-exchange-dev and can just skip them.
thank you. This error is solved. But another error comes up:
Error : Can’t open display: (FLTK internal error)
That is because you are trying to launch the Gmsh gui inside a docker container. To Get this to work, you Need to configure your docker container. See for instance: Running a graphical app in a Docker container, on a remote server | Yet another enthusiast blog!
Please note that the errors you are referring to is due to how you use
plasmah_mesh_with_…py which is not a FEniCS script. I would suggest you to modify this script to be used in a docker container (I.e. do not try to launch gmsh). But use other plotting tools to visualize the mesh inside the notebook once loaded into dolfin.