Install

pEigen is published on PyPI as peigentux and imported as peigen. Wheels are prebuilt, so on supported platforms you don't need a compiler.

Install with pip

The dense routines need only NumPy:

bash
pip install peigentux

The sparse routines (peigen.sparse, sparse Cholesky, iterative solvers) also need SciPy. The sparse extra installs it:

bash
pip install "peigentux[sparse]"

To pin it in a project, add peigentux>=2.1 to your requirements or to dependencies in pyproject.toml. With uv: uv add "peigentux[sparse]".

Supported platforms

Every wheel is built and tested in CI, and the tests fail if BLAS/LAPACK wasn't linked, so a slow fallback build can't ship by accident.

Operating systemArchitecturesBLAS / LAPACKPython
Linux (glibc 2.28+, manylinux_2_28)x86_64, aarch64OpenBLAS, bundled in the wheelCPython 3.10–3.15
macOSarm64 (Apple silicon), x86_64 (Intel)Apple AccelerateCPython 3.10–3.15

Not yet available as wheels:

  • Windows. Not built or tested yet.
  • Alpine and other musl-based Linux. pip falls back to the source distribution (see below).
  • Free-threaded Python (python3.14t, python3.15t). The extension doesn't declare support for running without the GIL yet.

Check your install

Print what was compiled into the extension you installed:

bash
python -c "import peigen; peigen.show_build_config()"
Example output on macOS (Apple silicon):
pEigen build configuration
--------------------------
version:               2.1.0
eigen_version:         5.0.1-dev+master
build_type:            Release
blas_enabled:          True
blas_backend:          accelerate
lapack_enabled:        True
lapack_backend:        accelerate
openmp_enabled:        False
vectorization_enabled: True
eigen_mpl2_only:       True

If lapack_enabled is False, everything still works, but dense solves, SVD and eigh use Eigen's own kernels, which are slower for large matrices. In code, peigen.build_config() returns the same information as a dict.

Build from source

On platforms without a wheel, pip builds the source distribution automatically. That needs:

  • a C++17 compiler and CMake 3.18 or newer
  • BLAS/LAPACK development files: optional, but recommended. On Linux, install OpenBLAS (for example sudo apt-get install libopenblas-dev) and point CMake at it:
bash
CMAKE_ARGS="-DBLA_VENDOR=OpenBLAS" pip install --no-binary peigentux peigentux

To work on pEigen itself, clone the repository with its Eigen submodule and install in editable mode:

bash
git clone --recurse-submodules https://github.com/TtheBC01/pEigen.git
cd pEigen
python -m pip install -e ".[test,sparse]"
pytest

See DEV.md for tests, benchmarks and release steps.

Why two names?

The name peigen on PyPI belongs to an unrelated project, so this one is distributed as peigentux (after eigen.tuxfamily.org). The import name is unchanged:

python
import peigen
from peigen import linalg, sparse, decomp

pip install peigen installs that other project, not this one.

Coming from pEigen 1.0 (the Boost.Python libpeigen module)? 2.0 was a rewrite; the changelog has a migration table.