pip install on offline systems

Offline (non-Internet-connected) systems may experience failures on installing Python packages. The package authors may not have CI setup for an offline test case, so they don’t realize it’s an issue. In general, Python packages can use pyproject.toml more effectively in a Python-standard way to overcome these issues.

Instead of telling users to manually install a package such as Numpy, use pyproject.toml instead of setuptools setup_requires. Setuptools assumes the computer will be internet-connected and even if the package is already installed the install will fail on an offline system.

To ensure a package like Numpy is installed first, for example where f2py is used, have a pyproject.toml file including:

[build-system]
requires = ["setuptools>=61.0.0", "wheel", "numpy"]
build-backend = "setuptools.build_meta"

This will auto-install the prereqs before the install begins. When including this pyproject.toml parameter, do not omit “setuptools”, “wheel” or the package may fail to install.