How to install Gmsh (mesh generator) on Ubuntu 22.04

The best way to install Gmsh on any recent Ubuntu version is to use pip:

sudo pip3 install --upgrade gmsh

In case you don’t have pip3 installed, run

sudo apt -y install python3-pip

After installation, you can open gmsh by just entering


in the terminal of your choice. In case you see an error message such as

/usr/bin/env: 'python': No such file or directory

see our post How to fix Ubuntu /usr/bin/env: python: No such file or directory for more details on how to fix this issue.