打印输出numpy的版本和配置信息
时间: 2023-10-16 19:09:04 浏览: 287
numpy基础入门100关
可以使用以下代码来打印输出numpy的版本和配置信息:
```python
import numpy as np
print("Numpy version:", np.__version__)
print("\nNumpy configuration:\n", np.show_config())
```
输出结果类似于:
```
Numpy version: 1.18.1
Numpy configuration:
blas_mkl_info:
libraries = ['mkl_rt', 'pthread']
library_dirs = ['/usr/local/lib']
define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
include_dirs = ['/usr/local/include']
blas_opt_info:
libraries = ['mkl_rt', 'pthread']
library_dirs = ['/usr/local/lib']
define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
include_dirs = ['/usr/local/include']
lapack_mkl_info:
libraries = ['mkl_rt', 'pthread']
library_dirs = ['/usr/local/lib']
define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
include_dirs = ['/usr/local/include']
lapack_opt_info:
libraries = ['mkl_rt', 'pthread']
library_dirs = ['/usr/local/lib']
define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
include_dirs = ['/usr/local/include']
```
其中,第一行输出了numpy的版本号,后面的部分则是numpy的配置信息。
阅读全文