pyGPCCA requires Python >= 3.6 to run. If any problems arise, please consult the Troubleshooting section.



pyGPCCA is available as a conda package and can be installed as:

conda install -c conda-forge pygpcca

This is the recommended way of installing, since this package also includes PETSc/SLEPc libraries. We use PETSc/SLEPc internally to speed up the computation of the leading Schur vectors. These are optional dependencies - if they’re not present, we compute a full Schur decomposition instead and sort it using the method introduced by Brandts (2002). Note that this scales cubically in sample number, making it essential to use PETSc/SLEPc for large sample numbers. PETSc/SLEPc implement iterative methods to only compute the leading Schur vectors, which is computationally much less expensive.


In order to install pyGPCCA from The Python Package Index, run:

pip install pygpcca
# or with libraries utilizing PETSc/SLEPc
pip install pygpcca[slepc]

Development version

If you want to use the development version of pyGPCCA from GitHub, run:

pip install git+


During the installation of petsc, petsc4py, slepc, and slepc4py, the following error(s) might appear:

ERROR: Failed building wheel for <package name>

However, this should be fine if in the end, it also outputs:

Successfully installed <package name>

To quickly verify that the packages have been installed, you can run:

python3 -c "import petsc4py; import slepc4py; print(petsc4py.__version__, slepc4py.__version__)"

Debian-based systems

Below are an alternative steps for installing PETSc/SLEPc, in case any problems arise, especially when installing from PyPI:

# install dependencies
sudo apt-get update -y
sudo apt-get install gcc gfortran libopenmpi-dev libblas-dev liblapack-dev petsc-dev slepc-dev -y

# install a message passing interface for Python
pip install --user mpi4py

# install petsc and and petsc4py
pip install --user petsc
pip install --user petsc4py

# install slepc and slepc4py
pip install --user slepc
pip install --user slepc4py


The most robust way is to follow the PETSc installation guide and the SLEPc installation guide or to take a look at our continuous integration steps for macOS.

The installation steps can be roughly outlined as:

# install dependencies
brew install gcc open-mpi openblas lapack arpack

# follow the PETSc installation steps
# follow the SLEPc installation steps

# install petsc4py
pip install --user petsc4py
# install slepc4py
pip install --user petsc4py