本文簡要介紹 python 語言中 numpy.show_config
的用法。
用法:
numpy.show_config()
顯示構建 NumPy 的係統中的庫。
打印有關構建 NumPy 的係統中的各種資源(庫、庫目錄、包含目錄等)的信息。
注意:
指定要打印的信息的類在
numpy.distutils.system_info
模塊中定義。信息可能包括:
language
:用於編寫庫的語言(主要是 C 或 f77)libraries
:係統中找到的庫的名稱library_dirs
:包含庫的目錄include_dirs
:包含庫頭文件的目錄src_dirs
:包含庫源文件的目錄define_macros
:distutils.setup
使用的預處理器宏baseline
:所需的最低 CPU 函數found
:係統支持的調度函數not found
:調度係統不支持的函數
NumPy BLAS/LAPACK 安裝說明
安裝 numpy 輪(
pip install numpy
或通過pip install numpy --only-binary :numpy: numpy
強製安裝)包括 BLAS 和 LAPACK 線性代數 API 的 OpenBLAS 實現。在這種情況下,library_dirs
報告使用 gcc/gfortran 編譯的原始構建時配置;在運行時,OpenBLAS 庫位於site-packages/numpy.libs/
(linux)、site-packages/numpy/.dylibs/
(macOS) 或site-packages/numpy/.libs/
(windows) 中。從源代碼安裝 numpy (
pip install numpy --no-binary numpy
) 在構建時搜索 BLAS 和 LAPACK 動態鏈接庫,受環境變量 NPY_BLAS_LIBS、NPY_CBLAS_LIBS 和 NPY_LAPACK_LIBS 的影響;或NPY_BLAS_ORDER和NPY_LAPACK_ORDER;或可選文件~/.numpy-site.cfg
。 NumPy 會記住這些位置並期望在運行時加載相同的庫。在 macOS 上的 NumPy 1.21+ 中,‘accelerate’(Apple 的 Accelerate BLAS 庫)按照默認的 build-time 搜索順序位於 ‘openblas’ 之後。
例子:
>>> 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']
相關用法
- Python numpy shape用法及代碼示例
- Python numpy shares_memory用法及代碼示例
- Python numpy searchsorted用法及代碼示例
- Python numpy scimath.log用法及代碼示例
- Python numpy signbit用法及代碼示例
- Python numpy setdiff1d用法及代碼示例
- Python numpy seterr用法及代碼示例
- Python numpy sort用法及代碼示例
- Python numpy scimath.logn用法及代碼示例
- Python numpy square用法及代碼示例
- Python numpy std用法及代碼示例
- Python numpy scimath.log2用法及代碼示例
- Python numpy sum用法及代碼示例
- Python numpy spacing用法及代碼示例
- Python numpy seterrobj用法及代碼示例
- Python numpy squeeze用法及代碼示例
- Python numpy scimath.arccos用法及代碼示例
- Python numpy s_用法及代碼示例
- Python numpy swapaxes用法及代碼示例
- Python numpy sctype2char用法及代碼示例
- Python numpy set_printoptions用法及代碼示例
- Python numpy source用法及代碼示例
- Python numpy save用法及代碼示例
- Python numpy scimath.log10用法及代碼示例
- Python numpy select用法及代碼示例
注:本文由純淨天空篩選整理自numpy.org大神的英文原創作品 numpy.show_config。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。