calfem-python icon indicating copy to clipboard operation
calfem-python copied to clipboard

gsmh

Open shayanmazloom opened this issue 5 years ago • 6 comments

Traceback (most recent call last): File "C:/Users/HP/AppData/Local/Programs/Python/Python37/hkl.py", line 91, in coords, edof, dofs, bdofs, elementmarkers = mesh.create() File "C:\Users\HP\AppData\Local\Programs\Python\Python37\lib\site-packages\calfem\mesh.py", line 230, in create raise IOError("Error: Could not find GMSH. Please make sure that the \GMSH executable is available on the search path (PATH).") OSError: Error: Could not find GMSH. Please make sure that the \GMSH executable is available on the search path (PATH).

shayanmazloom avatar Apr 09 '20 11:04 shayanmazloom

Make sure to install GMSH (http://gmsh.info/) and add it to the search PATH in Windows. In anaconda GMSH can be installed by using

conda install python-gmsh

jonaslindemann avatar Apr 12 '20 15:04 jonaslindemann

gmsh is in the PATH (i can launch it by "gmsh" in cmd), but issue is still occured

Traceback (most recent call last): File "form_plate_mesh.py", line 26, in coords, edof, dofs, bdofs, elementmarkers = mesh.create() File "D:\Programs\Python3-64bit\lib\site-packages\calfem\mesh.py", line 256, in create "Error: Could not find GMSH. Please make sure that the \GMSH executable is available on the search path (PATH).") OSError: Error: Could not find GMSH. Please make sure that the \GMSH executable is available on the search path (PATH).

Nikan888 avatar Apr 22 '20 08:04 Nikan888

Hello... did you find a solution for this issue? I'm having the same problem and I'm not being able to fix it by adding to the PATH

franciscofnunes avatar Feb 21 '21 16:02 franciscofnunes

Probably a more stable variant to find the path of the gmsh executable during runtime is something like:

>>> import subprocess
>>> import os
>>> cmd = "which"
>>> subprocess.call([cmd, "gmsh"])
/opt/conda/envs/modugen-core/bin/gmsh
0
>>>

See more here: https://stackoverflow.com/questions/55394905/how-to-find-the-location-of-an-executable-in-python

It's important to distinguish between Windows and Linux systems.

MaximilianFranz avatar Apr 21 '21 14:04 MaximilianFranz

I have updated the detection mechanism to be able to find gmsh in more places. Site-packages are also searched now.

Jonas

jonaslindemann avatar Apr 25 '21 21:04 jonaslindemann

Hello... did you find a solution for this issue? I'm having the same problem and I'm not being able to fix it by adding to the PATH

Please check the new release.

jonaslindemann avatar Apr 25 '21 21:04 jonaslindemann