numpy.show_config¶
- numpy.show_config()[source]¶
Show libraries in the system on which NumPy was built.
Print information about various resources (libraries, library directories, include directories, etc.) in the system on which NumPy was built.
See also
get_include
Returns the directory containing NumPy C header files.
Notes
Classes specifying the information to be printed are defined in the
numpy.distutils.system_info
module.Information may include:
language
: language used to write the libraries (mostly C or f77)libraries
: names of libraries found in the systemlibrary_dirs
: directories containing the librariesinclude_dirs
: directories containing library header filessrc_dirs
: directories containing library source filesdefine_macros
: preprocessor macros used bydistutils.setup
baseline
: minimum CPU features requiredfound
: dispatched features supported in the systemnot found
: dispatched features that are not supported in the system
NumPy BLAS/LAPACK Installation Notes
Installing a numpy wheel (
pip install numpy
or force it viapip install numpy --only-binary :numpy: numpy
) includes an OpenBLAS implementation of the BLAS and LAPACK linear algebra APIs. In this case,library_dirs
reports the original build time configuration as compiled with gcc/gfortran; at run time the OpenBLAS library is insite-packages/numpy.libs/
(linux), orsite-packages/numpy/.dylibs/
(macOS), orsite-packages/numpy/.libs/
(windows).Installing numpy from source (
pip install numpy --no-binary numpy
) searches for BLAS and LAPACK dynamic link libraries at build time as influenced by environment variables NPY_BLAS_LIBS, NPY_CBLAS_LIBS, and NPY_LAPACK_LIBS; or NPY_BLAS_ORDER and NPY_LAPACK_ORDER; or the optional file~/.numpy-site.cfg
. NumPy remembers those locations and expects to load the same libraries at run-time. In NumPy 1.21+ on macOS, ‘accelerate’ (Apple’s Accelerate BLAS library) is in the default build-time search order after ‘openblas’.
Examples
>>> import numpy as np >>> np.show_config() blas_opt_info: language = c define_macros = [('HAVE_CBLAS', None)] libraries = ['openblas', 'openblas'] library_dirs = ['/usr/local/lib']