Building from source on Mac#
Note
These instructions have been tested on macOS 11.1.
Install Apple Developer Tools. An easy way to do this is to open a terminal window, enter the command
xcode-select --install
and follow the prompts. Apple Developer Tools includes git, the software we need to download and manage the SciPy source code.
We recommend using conda to set up your environment on a Mac, as this will also allow you to install all necessary dependencies in a conda environment, instead of manually.
Installing without using conda#
Apple ships its own version of Python with OS X. However, we strongly recommend installing the official Python distribution.
Alternatively, use Python from one of the OS X package managers (Homebrew, MacPorts, Fink).
Compilers (C/C++/FORTRAN/Cython/Pythran)#
Though virtually any commercial C/C++ compiler may be used with SciPy, Clang C/C++ compiler, which is a Xcode command line tool, can be used for OS X. The only thing missing is the GNU FORTRAN compiler.
We recommend gfortran; this is a free, open source, F95 compiler. We suggest you use the following binaries:
gfortran installed via Homebrew, or,
http://r.research.att.com/tools/gcc-42-5666.3-darwin11.pkg (for Xcode 4.2 or higher)
See this site for the most recent links.
BLAS/LAPACK Installation#
You will also need to install a library providing the BLAS and LAPACK interfaces. ATLAS, OpenBLAS, and MKL all work. OpenBLAS can be installed via Homebrew.
Note
As of SciPy version 1.2.0, we do not support compiling against the system Accelerate library for BLAS and LAPACK. It does not support a sufficiently recent LAPACK interface.