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
:
-c conda-forge pyvista conda install
or can be installed via pip
by the following command:
pip install pyvista
This 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 vtk
3. 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.
-vuetify trame-vtk pip install trame
This will open an interactive 3D plot. You can rotate, zoom, and inspect the mesh.
With that, we’re ready to use PyVista!