首页 > 解决方案 > 使用 WSL 中的 numpy 在安装 MKL 时引发 RuntimeError(f'Cannot parse version {FULLVERSION}')

问题描述

我试图将 MKL 与 Windows 子系统 Linux 中的 numpy 链接 https://www.intel.com/content/www/us/en/developer/articles/technical/build-numpy-with-mkl-and-icc.html

在第 4 步中,我修改了site.cfg, numpy/distutils/intelccompiler.py, 和/numpy /distutil /fcompiler /intel.py,

python setup.py config --compiler=intelem build_clib --compiler=intelem build_ext --compiler=intelem install

我有

Traceback (most recent call last):
 File "setup.py", line 60, in <module>
   raise RuntimeError(f'Cannot parse version {FULLVERSION}')
RuntimeError: Cannot parse version 0+unknow

我必须安装ifort才能使用numpyMKL?如何解决上述错误信息?

标签: pythonnumpyintel-mkl

解决方案


您所指的文档是过时的文档。英特尔目前包括英特尔 MKL 优化包以及英特尔 Python 分发包。

英特尔 MKL 优化的 NumPy 和 SciPy 的预构建包可通过 pip 和 conda 通道使用。如果您安装了其中任何一个,您可以使用 pip/conda 包管理器安装这些包的最新版本。请在以下链接中找到多个可用选项以及安装命令:

https://anaconda.org/intel/scipy

https://anaconda.org/intel/numpy

或者,您还可以通过以下链接下载并安装独立的 Intel Distribution for Python 或完整的 Intel oneAPI Base Toolkit(包括 Intel Distribution for Python 以及其他 Intel 优化工具)来获取这些包以及其他 Intel 优化的 python 包:

https://software.intel.com/content/www/us/en/develop/articles/oneapi-standalone-components.html#python

https://www.intel.com/content/www/us/en/developer/tools/oneapi/base-toolkit.html

上述所有选项均免费提供。由于您在适用于 Linux 的 Windows 子系统中进行安装,因此请确保在 WSL shell 中下载并安装 Intel Distribution for Python 或 Intel oneAPI Base Toolkit 的 Linux 版本。


推荐阅读