PyVistaQt
raw JSON → 0.11.4 verified Fri May 01 auth: no python
PyVistaQt provides a Qt-based plotting backend for PyVista, enabling embedded 3D visualization in PyQt5/PySide2/PyQt6/PySide6 applications. Current version: 0.11.4. Release cadence: irregular, with occasional minor/patch updates.
pip install pyvistaqt Common errors
error No module named 'PyQt5' ↓
cause Missing Qt binding.
fix
Install a Qt binding: pip install PyQt5 (or PySide2, PyQt6, PySide6).
error ImportError: Could not import pyvistaqt. You must have a Qt binding installed (e.g., PyQt5). ↓
cause No Qt binding found or API not set correctly.
fix
Install a Qt binding (e.g., pip install PyQt5) and/or set the QT_API environment variable before importing pyvistaqt.
error AttributeError: module 'pyvistaqt' has no attribute 'MainWindow' ↓
cause MainWindow was removed in v0.11.0.
fix
Use BackgroundPlotter instead of MainWindow.
error RuntimeError: This program needs access to the screen. Please run with a virtual display or use off_screen. ↓
cause Running without a display (e.g., on a headless server) and not setting off_screen=True.
fix
Set
plotter = BackgroundPlotter(off_screen=True) or run with a virtual display (xvfb). Warnings
breaking Version 0.11.0 dropped support for Python 3.9; requires Python >=3.10. ↓
fix Upgrade to Python 3.10+ or stay on pyvistaqt <=0.10.2.
breaking Version 0.11.0 removed the `pyvistaqt.MainWindow` class; use `BackgroundPlotter` instead. ↓
fix Replace any 'MainWindow' usage with 'BackgroundPlotter'.
gotcha Importing pyvistaqt before setting the Qt API can cause 'ImportError: No Qt bindings available'. ↓
fix Set the Qt API via environment variable (e.g., os.environ['QT_API'] = 'pyqt5') before importing pyvistaqt, or install a Qt binding (PyQt5, PySide2, PyQt6, PySide6) first.
deprecated The `threaded` parameter in `BackgroundPlotter` is deprecated since v0.10.0; use `off_screen` and `auto_update` instead. ↓
fix Remove `threaded` and set `off_screen=False` and `auto_update=True` for similar behavior.
Install
conda install -c conda-forge pyvistaqt Imports
- BackgroundPlotter
from pyvistaqt import BackgroundPlotter - QtInteractor
from pyvistaqt import QtInteractor - MultiPlotter
from pyvistaqt import MultiPlotter
Quickstart
import pyvista as pv
from pyvistaqt import BackgroundPlotter
plotter = BackgroundPlotter()
mesh = pv.Cube()
plotter.add_mesh(mesh, color='red')
plotter.show()