Fail to import the package "bempp.api"

Hi BEMPP team,
I’m trying to use BEMPP-CL for the first time. I want to install the package directly on my pc. However, I fail to import the package “bempp.api” at the beginning of my script. It told me that “Gmsh is not found” while the package “gmsh” can be imported correctly. How can I deal with this problem? Thank you so much for your help!

The bempp-cl library is installed correctly but it can’t find the path of the Gmsh executable. Creating meshes of the standard geometries with the shapes library requires Gmsh to be installed since it runs a Gmsh script in the background.

I notice you are using Windows, in which case Bempp searches for gmsh.exe in the PATH. However, when Gmsh is installed through Pip, the executable is called gmsh instead of gmsh.exe.

There are two workarounds, which you should perform immediately after importing the bempp-cl library. In both cases, you need to set the bempp-cl global variable GMSH_PATH manually. The first option is to run:
bempp.api.GMSH_PATH = bempp.api.utils.which("gmsh")
If bempp.api.GMSH_PATH remains empty (None), search for the Gmsh executable in your command window: where gmsh and copy-paste the entire path in Python:
bempp.api.GMSH_PATH = "full/path/to/gmsh/executable"

Alternatively, you can download the Gmsh executable from the Gmsh website and install it in a folder within your PATH environment.

Thank you so much for your kind help. I have solved thie problem.

This issue should be solved in the latest version of bempp-cl (after pull request 153, Wider search of gmsh on Windows. by evantwout · Pull Request #153 · bempp/bempp-cl · GitHub).