Getting Started
Installation
1. Install Pyvista:
The only prerequisite for installing PyVista is Python itself. We can use Anaconda or Pip as virtual environment and package manager for Python.
PyVista can be installed by conda-forge:
conda install -c conda-forge pyvistaor can be installed via pip by the following command:
pip install pyvistaThis will automatically install PyVista along with all the necessary dependencies.
2. Install vtk for 3D Visualization:
PyVista builds on VTK, so if you’re running into issues with installation or if you want to manually install VTK, you can install it separately:
pip install vtk3. Verify the Installation:
Once installed, you can verify if everything is set up correctly by opening a Python environment (either a Python shell or a Jupyter notebook) and typing:
import pyvista as pv
print(pv.__version__)4. Optional: Install trame for 3D Visualization:
We will be going to install trame library which is an optional dependency for interactive notebook rendering.
pip install trame-vuetify trame-vtkThis will open an interactive 3D plot. You can rotate, zoom, and inspect the mesh.
With that, we’re ready to use PyVista!