Error while plotting using PyVista

The plotting code doesn’t work in my system anymore.

import pyvista
pyvista.set_jupyter_backend("ipygany")
cells, types, x = plot.create_vtk_mesh(V)
grid = pyvista.UnstructuredGrid(cells, types, x)
grid.point_data["u"] = uh.x.array.real
grid.set_active_scalars("u")
plotter = pyvista.Plotter()
plotter.add_mesh(grid, show_edges=True)
warped = grid.warp_by_scalar()
plotter.add_mesh(warped)
plotter.show()

This throws an error

Traceback (most recent call last):
  File "/Users/varunkumar/Documents/FEniCSx Codes/poissonx.py", line 46, in <module>
    plotter.add_mesh(grid, show_edges=True)
  File "/Users/varunkumar/opt/anaconda3/envs/fenicsx/lib/python3.10/site-packages/pyvista/plotting/plotting.py", line 3084, in add_mesh
    self.mapper.set_scalars(
  File "/Users/varunkumar/opt/anaconda3/envs/fenicsx/lib/python3.10/site-packages/pyvista/plotting/mapper.py", line 652, in set_scalars
    check_colormap(cmap)
  File "/Users/varunkumar/opt/anaconda3/envs/fenicsx/lib/python3.10/site-packages/pyvista/jupyter/pv_ipygany.py", line 101, in check_colormap
    if cmap.capitalize() in colormaps:
AttributeError: 'NoneType' object has no attribute 'capitalize'

Any help would be appreciated

Do you have matplotlib installed? It seems like pyvista cannot find a colormap.