问题描述
我是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库以加快numpy
和scipy
的速度.
In my case, conda
is installing the mkl libraries to speed up numpy
and scipy
.
这篇关于Pyinstaller numpy“英特尔MKL致命错误:无法加载mkl_intel_thread.dll"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!