Install gmsh outside Docker container#

These commands will install Gmsh and the PyLith Python module into a Python virtual environment in $HOME/gmsh.


For Gmsh we strongly recommend using your system Python or a binary Python package for your system downloaded from as opposed to Python from Conda or Anaconda. This reduces the disk space and provides a simpler installation.

# Set some variables (tune to your system)

# Create and activate the Python virtual environment
python3 -m venv $GMSH_DIR
source $GMSH_DIR/bin/activate

# Install Gmsh
pip install gmsh

# Install the Python module
mkdir -p $GMSH_DIR/lib/python$PYTHON_VERSION/site-packages/pylith/meshio
touch $GMSH_DIR/lib/python$PYTHON_VERSION/site-packages/pylith/meshio/__init.py__
touch $GMSH_DIR/lib/python$PYTHON_VERSION/site-packages/pylith/__init.py__

# Copy from running Docker container
# (alternatively, download it from
docker cp pylith-dev-workspace:/opt/pylith/src/pylith/pylith/meshio/ $GMSH_DIR/lib/python$PYTHON_VERSION/site-packages/pylith/meshio/