vtk_backend#
- vtk_backend() str[source]#
Return the name of the VTK build PyVista is running against.
'vtk'is stock VTK (the default);'cvista'is the community fork, selected by installingpyvista[cvista]or settingPYVISTA_VTK_BACKENDbefore importing PyVista. Use it to branch on features a given build ships. The returned name round-trips throughPYVISTA_VTK_BACKEND.Added in version 0.49.
- Returns:
strName of the active backend:
'vtk'for stock VTK, otherwise the backend’s package name (e.g.'cvista').
Examples#
Download Python source code | Download Jupyter notebook
The value depends on which build is installed, so this example is not run.
>>> import pyvista as pv
>>> pv.vtk_backend()
'vtk'
Raise a clear error for a build that cannot support a feature:
>>> if pv.vtk_backend() != 'vtk':
... msg = (
... f'This feature is not supported on the {pv.vtk_backend()} backend.'
... )
... raise RuntimeError(msg)