Getting Started

Getting Started#

The only prerequisite for installing PyVista is Python itself. If you don’t have Python yet and want the simplest way to get started, we recommend you use the Anaconda Distribution.

PyVista can be installed locally with conda or pip. If you’d prefer it, you can also run PyVista on the cloud using Google Colab or MyBinder. For more detailed instructions, see the installation guide below.

Installation#

PyVista can be installed on several environments, including, but not limited to:

pip install 'pyvista[all,trame]' jupyterlab
conda install -c conda-forge pyvista jupyterlab trame trame-vuetify trame-vtk ipywidgets

You can then plot in Jupyter with either a static or interactive backend:

import pyvista as pv
from pyvista import examples

dataset = examples.download_lucy()
dataset.plot(smooth_shading=True, color='white')
_images/getting-started-1_00_00.png

MyBinder#

MyBinder, similar to Google Colab, allows you to run Jupyter notebooks on the cloud. Click on the link below to open up a MyBinder environment to run PyVista.

Launch on Binder

Google Colab#

Google Colab is a moving target and many of the “cloud ready” JavaScript plotting environments that make PyVista so great to work with do not seem to be available on Google Colab. However, we still have a working PyVista example for Google Colab with static plotting.

Visit the PyVista on Colab notebook to see PyVista in action. The minimum code to get PyVista running in a Colab environment is:

!apt-get install -qq xvfb libgl1-mesa-glx
!pip install pyvista -qq
import pyvista

pyvista.set_jupyter_backend('static')
pyvista.global_theme.notebook = True
pyvista.start_xvfb()