0

What are the common ways to execute a gmsh mesh script from a python spyder window?

The only way I have found so far is the following, but I would like to know if some other possibilities might be:

subprocess.call(['sudo', 'gmsh', 'script.py'])

By the way I have an issue here which is the need for sudo to be able to execute gmsh.

How can I get rid of that ?

I am on ubuntu 22.04, spyder 5.3.2, python 3.9.12, gmsh 4.8.4.

Thank you in advance for your help

Oli

buhtz
  • 10,774
  • 18
  • 76
  • 149
OlM
  • 47
  • 5
  • 1
    Why exactly do you need sudo to run `gmsh`? – Dominik Stańczak Aug 02 '22 at 11:44
  • but how can I get rid of sudo to run gmsh then ? – OlM Aug 03 '22 at 04:46
  • That's the question - why is it that you need sudo to run gmsh in the first place! If you run it just from the shell, without Python, do you still have to run it via sudo? If so, that's a problem with your user/file permissions or with the gmsh installation and you should figure that out first, without the Python layer.. – Dominik Stańczak Aug 03 '22 at 06:18
  • well, I decided to uninstall/reinstall gmsh and that solved the problem. However a new one came which is "sh: 1: python: not found" when executing (so failing) a gmsh script... – OlM Aug 03 '22 at 12:09

0 Answers0