Skip to content

Installing PAOFLOW

Anooja Jayaraj edited this page May 23, 2026 · 1 revision

Installing PAOFLOW

Overview

PAOFLOW is a Python package for constructing and operating on Hamiltonians derived from projections of DFT wavefunctions on atomic orbital bases.

The current code base supports:

  • Python 3.10 or newer
  • Linux / POSIX environments

For most users, installation is straightforward with pip. For development work or MPI-heavy workflows, a Conda-based environment is usually the safest option.


Before You Install

Python version

PAOFLOW currently requires:

python --version

Use Python 3.10 or later.

Recommended Python distribution

A Conda-based distribution is recommended, especially if you need mpi4py linked cleanly against your system MPI libraries:


MPI Requirement

PAOFLOW depends on mpi4py, so a working MPI setup is part of a healthy installation.

Recommended install path

If you are using Conda or Mamba, install mpi4py there first:

conda install mpi4py

Pip-based install

If your system already has a compatible MPI implementation such as OpenMPI or MPICH, pip also works:

pip install mpi4py

Why this matters

mpi4py needs to link against the MPI libraries available on your machine. If MPI is misconfigured, PAOFLOW may install but fail at runtime.


Installation Options

Option 1: Install from PyPI

This is the simplest route if you just want to use PAOFLOW:

pip install PAOFLOW

This installs the core package and its main dependencies.

Option 2: Install from a local checkout

If you already cloned the repository and want to install from source:

pip install .

If you do not have administrator privileges:

pip install --user .

This is the standard manual installation path from the repository root.

Option 3: Editable install for development

If you plan to modify the source code and want changes to be picked up without reinstalling every time:

pip install -e .[dev]

This installs PAOFLOW in editable mode together with the development dependencies.

Note: even with an editable install, you still need to restart your Python interpreter or Jupyter kernel after code changes.


Optional Dependency Groups

PAOFLOW defines several optional feature groups. Install them by appending the extra name in brackets.

Available extras

Extra What it adds Install command
weyl_search z2pack, tbmodels pip install PAOFLOW[weyl_search]
graphics vtk, matplotlib pip install PAOFLOW[graphics]
transport pyyaml, psutil, pydantic pip install PAOFLOW[transport]
pyskeaf scikit-image, shapely, joblib, pandas pip install PAOFLOW[pyskeaf]
fast numba pip install PAOFLOW[fast]
dev pre-commit, pytest pip install PAOFLOW[dev]

Installing multiple extras together

You can combine extras in a single command:

pip install PAOFLOW[pyskeaf,fast]

This is useful if you want a richer installation without pulling in every optional dependency.


Common Installation Setups

Minimal user install

Good for general use:

pip install PAOFLOW

Development install

Good if you want tests and local development tools:

pip install -e .[dev]

Visualization-oriented install

Useful if you need plotting or graphical post-processing:

pip install PAOFLOW[graphics]

High-performance / accelerated install

Useful if you want optional JIT acceleration:

pip install PAOFLOW[fast]

Transport workflow install

Useful if you need the transport-related dependencies:

pip install PAOFLOW[transport]

Full-feature example

If you want several capabilities together:

pip install PAOFLOW[graphics,transport,pyskeaf,fast]

Recommended Conda Workflow

If you want a clean and reproducible install, this is a good starting point:

conda create -n paoflow python=3.10
conda activate paoflow
conda install mpi4py
pip install PAOFLOW

For development:

conda create -n paoflow-dev python=3.10
conda activate paoflow-dev
conda install mpi4py
pip install -e .[dev]

This avoids many of the MPI-related issues that can happen in mixed system environments.


Verifying the Installation

Basic import test

After installation, check that PAOFLOW imports correctly:

python -c "import PAOFLOW; print('PAOFLOW import OK')"

Check the pyskeaf CLI

If you installed the pyskeaf extra, a command-line tool should also be available:

pyskeaf --help

If that command is not found, make sure the pyskeaf extra was installed in the same environment you are currently using.


Core Runtime Dependencies

The current package metadata declares these main dependencies for the base install:

  • numpy
  • scipy
  • mpi4py
  • pandas

These are installed automatically when you install PAOFLOW through pip.


Notes for Developers

Development dependencies

The dev extra currently installs:

  • pre-commit
  • pytest

A typical developer setup is:

pip install -e .[dev]
pre-commit install
pytest

Editable install reminder

Editable mode updates Python imports to point at your working tree, but running sessions still cache imported code. Restart the interpreter or notebook kernel after changes.


Troubleshooting

mpi4py install or runtime problems

If mpi4py fails to build or import:

  1. Make sure an MPI implementation is installed on your system.
  2. Prefer installing mpi4py via Conda:
    conda install mpi4py
  3. Reinstall PAOFLOW in the same environment.

Wrong Python environment

If pip install succeeds but python cannot import PAOFLOW, you are likely using different environments for pip and python.

Use:

which python
which pip
python -m pip install PAOFLOW

Using python -m pip is often safer than calling pip directly.

CLI command not found

If pyskeaf --help fails:

  • confirm that you installed the pyskeaf extra
  • confirm that your shell is using the same environment where PAOFLOW was installed

Quick Reference

Install from PyPI

pip install PAOFLOW

Install from source

pip install .

Install from source in editable mode with development tools

pip install -e .[dev]

Install with optional extras

pip install PAOFLOW[graphics,transport]

Install mpi4py with Conda

conda install mpi4py

Summary

For most users, the recommended path is:

  1. create or activate a Python 3.10+ environment
  2. ensure mpi4py is installed cleanly
  3. install PAOFLOW with pip
  4. add extras only as needed

If you are developing PAOFLOW, use an editable install with the dev extra and restart your interpreter after source changes.

Clone this wiki locally