Registry / data / pyvista

pyvista

JSON →
library0.48.4pypypi✓ verified 27d ago

PyVista is a high-level Pythonic interface to the Visualization Toolkit (VTK), simplifying 3D plotting, mesh data structures, and filtering methods for spatial datasets. It is an active project, currently at version 0.47.3, with frequent patch releases and minor versions addressing bugs and introducing new features.

pip install pyvista
INSTALL
IMPORT
SIG · PYVISTA
P
pyvista
datapythonv0.48.4
Install
14.3s avg
Import
928ms
Disk
610MB
Pass rate
7/ 10
Env Coverage7 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v0.48.4 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✕ build_error
✓ 14.9s
py 3.11
✓ —
✓ 14.2s
py 3.12
✓ —
✓ 13.6s
py 3.13
✕ build_error
✓ 13.1s
py 3.9
✕ build_error
✓ 15.8s
610MB installed
● package 610MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

pyvista
✓ import pyvista as pv
The convention is to import PyVista as `pv` for brevity and consistency.
examples
✓ from pyvista import examples
Commonly used to access built-in example datasets and functions for quick demonstrations.

This example demonstrates how to download a sample 3D mesh, assign scalar data to its points for coloring, and then visualize it using PyVista's `Plotter` with a specified colormap and camera position.

import pyvista as pv from pyvista import examples # Download and load an example mesh (e.g., the Stanford dragon) mesh = examples.download_dragon() # Add scalar data based on point coordinates for coloring mesh['scalars'] = mesh.points[:, 1] # Create a plotter and add the mesh plotter = pv.Plotter() plotter.add_mesh(mesh, cmap='plasma', show_edges=True) # Set the camera position and display the plot plotter.show(cpos='xy')
Debug
Known issues
breakingThe behavior of `Plotter.show()` regarding image depth storage changed in v0.47. It no longer automatically stores the last image depth.
fix
To obtain image depth after the plotter closes, you must explicitly enable `store_image_depth=True` in the `show()` method (e.g., `plotter.show(store_image_depth=True)`).
affects: >=0.47.0
breakingSetting new attributes on PyVista classes was restricted starting from v0.46.0.
fix
In v0.46.0 and v0.46.1, you had to use `pyvista.set_new_attribute(obj, name, value)`. In v0.46.3+, this was relaxed: new *public* attributes still require `set_new_attribute()`, but *private* attributes (prefixed with `_`) can be set directly.
affects: 0.46.0 - 0.46.2
gotchaPerformance of `mesh.ray_trace` was significantly slower in versions 0.46.0 to 0.46.3 due to the removal of `obbTree` caching.
fix
Upgrade to PyVista v0.46.4 or later, which re-enabled the caching mechanism and resolved the performance degradation.
affects: 0.46.0 - 0.46.3
deprecatedAccessing arrays in `DataSetAttributes` (e.g., `mesh.point_data` or `mesh.cell_data`) using integer indexing (`obj[index]`) is deprecated.
fix
Use the `DataSetAttributes.get_array(index)` method instead of the `[]` operator for integer indexing. String-based access (`obj['array_name']`) remains valid.
affects: >=0.32.0
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'pyvista'
The PyVista library is not installed in the current Python environment.
fix
Install PyVista using pip: `pip install pyvista`
failed to get the display
PyVista attempts to create a rendering window on a system without a graphical display (e.g., a server or container), and the default VTK backend cannot find an X server.
fix
Enable off-screen rendering by setting `pyvista.OFF_SCREEN = True` before any plotting, and ensure an appropriate off-screen VTK backend (like `osmesa` or `egl`) is available, or use `xvfb`. Example: `import pyvista; pyvista.OFF_SCREEN = True; # your plotting code`
AttributeError: 'PolyData' object has no attribute 'scalars'
The `mesh.scalars` attribute was deprecated in PyVista versions >0.30 in favor of `mesh.active_scalars` for retrieving the currently active scalar array.
fix
Replace `mesh.scalars` with `mesh.active_scalars` to access the active scalar array. Example: `mesh.active_scalars`
ValueError: 'your_backend_name' is not a valid backend. Options are: ['ipyvtk_simple', 'panel', 'client', 'server', 'trame']
An invalid or unsupported backend name was provided when attempting to set the PyVista Jupyter backend.
fix
Choose one of the valid backend names from the error message. Example: `pyvista.set_jupyter_backend('ipyvtk_simple')`
AttributeError: 'pyvista.Plotter' object has no attribute 'AddActor'
The user is attempting to use a VTK-style method name (e.g., `AddActor` with capital 'A') on a PyVista `Plotter` object, whereas PyVista uses Pythonic, lowercase method names.
fix
Use the PyVista-style method: `plotter.add_actor(...)`
Upgrade
Version history
0.48.4latest on PyPI · released May 18, 2026
Audit
Dependencies
vtkrequiredPyVista directly inherits types from the VTK library, serving as its core 3D visualization backend.
numpyrequiredProvides the core foundation for PyVista's data array access and manipulation.
matplotlibrequiredUsed for colormaps and 2D plotting functionalities.
pillowrequiredUsed for saving screenshots of plots.
imageiorequiredUsed for reading images and writing animations.
poochrequiredManages the download and caching of example datasets.
scoobyrequiredProvides tools for reporting and debugging the PyVista environment.
trameoptionalUsed for client and server-side rendering in Jupyter environments.
meshiooptionalEnables input/output for a wide variety of mesh file formats.
Agent activity
13 hits · last 30 days
node
10
OpenAI (training)
1
Resources
pyvista — pip install pyvista · libregistry