Pyinstaller numpy“Intel MKL 致命错误:无法加载 mkl_intel_thread.dll" [英] Pyinstaller numpy "Intel MKL FATAL ERROR: Cannot load mkl_intel_thread.dll"

查看:36
本文介绍了Pyinstaller numpy“Intel MKL 致命错误:无法加载 mkl_intel_thread.dll"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 Python 应用程序的新手.我正在尝试使用 pyinstaller 构建我的 python GUI 应用程序.我的应用程序依赖于以下软件包:PyQt4、numpy、pyqtgraph、h5py.我正在使用 WinPython-32bit-3.4.4.1.

I'm new with python apps. I'm trying to build my python GUI app with pyinstaller. My app depends on the following packages: PyQt4, numpy, pyqtgraph, h5py. I'm working with WinPython-32bit-3.4.4.1.

我使用以下命令构建应用程序:

I build the app with this command:

pyinstaller --hidden-import=h5py.defs --hidden-import=h5py.utils --hidden-import=h5py.h5ac --hidden-import=h5py._proxy VOGE.py

我使用 pyinstaller 创建的 dist 目录中的 exe 文件启动我的应用程序,它似乎工作正常,直到程序调用 numpy 并因此错误而崩溃:

I launch my app with the exe file in the dist directory created by pyinstaller and it seems work fine until the program call numpy and crash with this error:

英特尔 MKL 致命错误:无法加载 mkl_intel_thread.dll

Intel MKL FATAL ERROR: Cannot load mkl_intel_thread.dll

软件目录中不存在mkl_intel_thread.dll;但是将文件复制到程序的根目录中,我得到了同样的错误

The mkl_intel_thread.dll is not present in the software directory; but with the file copied in the root dir of the program I got the same error

感谢您的帮助

推荐答案

我创建了一个hook-numpy.py来处理这个问题:

I created a hook-numpy.py to deal with this problem:

from PyInstaller import log as logging 
from PyInstaller import compat
from os import listdir

libdir = compat.base_prefix + "/lib"
mkllib = filter(lambda x : x.startswith('libmkl_'), listdir(libdir))
if mkllib <> []: 
   logger = logging.getLogger(__name__)
   logger.info("MKL installed as part of numpy, importing that!")
   binaries = map(lambda l: (libdir + "/" + l, ''), mkllib)

就我而言,conda 正在安装 mkl 库以加速 numpyscipy.

In my case, conda is installing the mkl libraries to speed up numpy and scipy.

这篇关于Pyinstaller numpy“Intel MKL 致命错误:无法加载 mkl_intel_thread.dll"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆