1

I try to run a Gmsh python script from the command line (or from PyCharm or Spyder)

gmsh script.py

but I get the following error:

sh: 1: python: not found

also in the Gmsh console there is this error:

Done - 1 error : Abnormal server termination (Socket listening timeout on socket /home/user/.gmshsock2)

I did check python3 version which looks fine:

$ python3 --version
Python 3.10.4

What could be the problem?

Can anyone help to solve this ?

Thanks

Oli

OlM
  • 47
  • 5

1 Answers1

1

The problem might be that Python is installed on your system, but that there is no symlink from python3 to python. Therefore python3 is a valid command and confirms that python is installed, but the command python is no available.

As you tagged ubuntu, i would suggest you to install the package python-is-python3 with the following command

sudo apt install python-is-python3

This package will create a symlink from /usr/bin/python to /usr/bin/python3, and therefore gmsh can execute the command python.

Mime
  • 1,142
  • 1
  • 9
  • 20
  • Thank you very much. This solved the " sh: 1: python: not found " error. – OlM Aug 03 '22 at 14:18
  • The second error, visible in the gmsh console, " Abnormal server termination (Socket listening timeout on socket /home/user/.gmshsock2) ", remains however – OlM Aug 03 '22 at 14:19