bundles / scipy 1.17.1 / docs
Doc
Building from source
docs/building:index
Building SciPy from source requires setting up system-level dependencies (compilers, BLAS/LAPACK libraries, etc.) first, and then invoking a build. The build may be done in order to install SciPy for local usage, develop SciPy itself, or build redistributable binary packages. And it may be desired to customize aspects of how the build is done. This guide will cover all these aspects. In addition, it provides background information on how the SciPy build works, and links to up-to-date guides for generic Python build & packaging documentation that is relevant.
System-level dependencies
SciPy uses compiled code for speed, which means you need compilers and some other system-level (i.e, non-Python / non-PyPI) dependencies to build it on your system.
Building SciPy from source
If you want to only install SciPy from source once and not do any development work, then the recommended way to build and install is to use pip. Otherwise, conda is recommended.
Building from source to use SciPy
Building from source for SciPy development
If you want to build from source in order to work on SciPy itself, first clone the SciPy repository
git clone https://github.com/scipy/scipy.git cd scipy git submodule update --init
Then you want to do the following:
Create a dedicated development environment (virtual environment or conda environment),
Install all needed dependencies (build, and also test, doc and optional dependencies),
Build SciPy with our
spindeveloper interface.
Step (3) is always the same, steps (1) and (2) are different between conda and virtual environments:
To build SciPy in an activated development environment, run
spin buildThis will install SciPy inside the repository (by default in a build-install directory). You can then run tests (spin test), drop into IPython (spin ipython), or take other development steps like build the html documentation or running benchmarks. The spin interface is self-documenting, so please see spin --help and spin <subcommand> --help for detailed guidance.
Installing static type stubs
If you would like to install static type stubs to aid your development of SciPy, you can include the scipy-stubs package in your development environment. It is available on PyPI and conda-forge - see the scipy-stubs installation guide.