Pyvista Plotter shows "Unable to connect" in widget on Jupyter Docker container


I am using the Jupyterlab docker image (tried both the stable and nightly builds) to run FEniCSx and when I try to plot the mesh with pyvista, the widget instead shows an “Unable to connect” tab. I tried running the following according to this other post:

!python3 -m pip install --no-cache-dir pyvista[trame] -U

But when I run my script, this is what I see:

from mpi4py import MPI
from dolfinx import fem, io, nls, log, mesh, plot, cpp, plot
import numpy as np
import ufl
from petsc4py.PETSc import ScalarType
import pyvista

# create simple rectangular mesh
points = [[0.0, 0.0], [1.0, 1.0]]
domain = mesh.create_rectangle(MPI.COMM_WORLD, points, [10 , 10])
P1 = ufl.FiniteElement('CG', domain.ufl_cell(), 1)
element = ufl.MixedElement([P1, P1])
V = fem.FunctionSpace(domain, element)

# attempt to plot mesh with pyvista
topology, cell_types, geometry = plot.create_vtk_mesh(domain, domain.topology.dim)
grid = pyvista.UnstructuredGrid(topology, cell_types, geometry)

plotter = pyvista.Plotter()
plotter.add_mesh(grid, show_edges=True)