Missing function in dolfinx.io.gmshio

Dear all,
I am using dolfinx 0.5.2 and gmsh 4.8.0 (Debian package). When i try to import model_to_mesh from dolfinx.io.gmshio, i obtain the following error:

AttributeError: module ‘dolfinx.io.gmshio’ has no attribute 'model_to_mesh

If i list the functions in dolfinx.io.gmshio, there is actually no model_to_mesh. Does anyone know how to fix this?
Thanks you so much

  1. Could you print dolfinx.io.gmshio._has_gmsh?
  2. What is the output of python3 -c "import gmsh"?
  3. Did you have gmsh installed when you installed DOLFINx via apt-get?

Reference for variables:

1 Like

Thanks for your answer.
This test allowed me to find the error: dolfinx.io.gmshio._has_gmsh returned False in my Python Development Environment but True using the terminal because I had not restarted the python kernel after installing python3-gmsh using apt-get… Now it works perfectly.
Thanks!