Error when trying to reproduce tutorial example


I am trying to reproduce the second Navier Stokes example described in the dolfinx tutorial Test problem 2: Flow past a cylinder (DFG 2D-3 benchmark) — FEniCSx tutorial
I am working in a docker container.

My script is simply

import gmsh

print(f"DOLFINx version: {dolfinx.version} is installed")

And I got the following error message

Traceback (most recent call last):
File “/home/fenicsx/shared/”, line 1, in
import gmsh
File “/home/fenicsx/shared/”, line 3, in
mesh, cell_markers, facet_markers = io.gmshio.read_from_msh(“mesh.msh”, MPI.COMM_WORLD, gdim=2)
AttributeError: module ‘’ has no attribute ‘gmshio’

I tried to fix this issue by typing

pip install gmsh

in my docker container
which produced

Collecting gmsh
Downloading gmsh-4.10.5-py2.py3-none-manylinux1_x86_64.whl (38.3 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 38.3/38.3 MB 6.0 MB/s eta 0:00:00
Installing collected packages: gmsh
Successfully installed gmsh-4.10.5
WARNING: Running pip as the ‘root’ user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: 12. Virtual Environments and Packages — Python 3.10.6 documentation

But it did not solved the problem.

The dolfinx release is

What am I doing wrong?

Thank you.


What docker image are you using? Please Remember to pull the latest version, as described in:

Good morning Jorgen,

I uploaded the latest version you mention in the tutorial and it works well.
I was not using the version you recommend in the tutorial because I dont want to use jupyter.
I will check if I can modify my docker image to use your last version.

Thank you for the quick answer.


You can easily do that by modifying the entrypoint as explained in: