OpenModes icon indicating copy to clipboard operation
OpenModes copied to clipboard

OpenModes in Jupyter "gmsh not found"

Open showard-duck opened this issue 4 years ago • 1 comments

Hello! I'm relatively new to Python (and Anaconda), so if I'm missing something obvious I apologize.

I've installed OpenModes via Anaconda on my Windows machine and for the life of me, I can't get Jupyter or Spyder to recognize that gmsh is installed.

I'm running the examples provided on openmodes.readthedocs.io and receive the error "MeshError: gmsh not found" in both Jupyter and Spyder. I've checked the referenced file location and there is clearly a gmsh.py file right where the code is looking for it.

Background: I've tried re-installing OpenModes, gmsh, and even uninstalled Anaconda and restarted the whole process from scratch, but still have the issue. Note that I did have to install gmsh using pip as the conda-forge install always hits several failures/errors. I've also tried installing and enabling Jupyter Environment Kernels as some folks mentioned this helped with failures to import packages, but no luck.

I appreciate any assistance, thank you! Sam

showard-duck avatar Jun 13 '20 00:06 showard-duck

It sounds like OpenModes cannot find gmsh within its path. The gmsh installation from conda-forge does put the gmsh executable within the path. I'm not sure whether the pip package for gmsh is related to the conda-forge package, and from what you are saying it sounds like this pip package does not put gmsh in the path. Also note that gmsh can just be installed using the binaries from it's website - OpenModes does not use any of the new gmsh Python APIs, it just calls the executable directly.

To put gmsh in the path, you will need to find the folder containing of gmsh.exe (assuming you are using Windows), and either add this to your PATH environment variable. Alternatively, you can create a specific GMSH_PATH environment variable containing the full path and filename of gmsh. Note that for environment variable changes to take effect under Windows, you sometimes need to logout and login again.

I'm curious to know what the problem is with installing gmsh from the conda-forge. I chose this option as I thought it would be the easiest. I assume you are using Python 3.7.

Also, note that the file gmsh.py is not gmsh itself. This is just a file I wrote to interface with the gmsh program.

DavidPowell avatar Jun 13 '20 11:06 DavidPowell