Installation

Versions of pyvista are available through PyPI as astro-pyvista (pyvista is the name of another product!). Python >=3.9 is required (largely to encourage people not to use unsupported Python versions).

pip install astro-pyvista

However, we recommend that you create a new virtual environment for pyvista to avoid issues with package conflicts. If you are using Anaconda, you can create a new virtual environment with:

conda env create --name pyvista python=3.12
conda activate pyvista

Alternatively, you can use Python venv:

python -m venv pyvista
source pyvista/bin/activate  (in bash)

Once you have activated your virtual environment:

pip install astro-pyvista

If you are using Anaconda Navigator, you can use the Environments section on the left.

Editable installation into Python distribution

If you may be editing the code, you can download pyvista from github, and do an editable install:

git clone https://github.com/holtzmanjon/pyvista
cd pyvista
pip install -e .

Installation using environment variables

As an alternative to using a pip installation, you can define an environment variable PYVISTA_DIR that refers to the top level pyvista directory, e.g.

setenv PYVISTA_DIR /pathto/pyvista   (csh/tcsh)
export PYVISTA_DIR=/pathto/pyvista   (bash)

Then add $PYVISTA_DIR/python to your PYTHONPATH. In csh/tcsh:

setenv PYTHONPATH $PYVISTA_DIR/python:$PYTHONPATH
if ( $?PYTHONPATH ) then
  setenv PYTHONPATH ${PYTHONPATH}:/$PYVISTA_DIR/python
else
  setenv PYTHONPATH /some/other/path
endif

In sh/bash:

if [ -z $PYTHONPATH  ] ; then
  export PYTHONPATH=$PYVISTA_DIR/python
else
  export PYTHONPATH=$PYVISTA_DIR/python:$PYTHONPPATH
fi

To keep these definitions across all new sessions, add these to your .cshrc/.tcshrc or .bashrc/.profile file.

Installation using modules

Alternatively, use a package management system, e.g., modules, to set these variables when the package is loaded. There is a sample modules file in $PYVISTA_DIR/etc/modulefile