Pyinstaller numpy “Intel MKL FATAL ERROR: Cannot load mkl_intel_thread.dll”

前端 未结 7 1550
后悔当初
后悔当初 2020-12-08 17:23

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 wit

7条回答
  •  借酒劲吻你
    2020-12-08 17:36

    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)
    

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

提交回复
热议问题