Cannot load mkl_intel_thread.dll on python executable
EDIT:
Try to copy all files starting with
mkl
you find underLibrary\bin
ornumpy\core
into the build folder, as well aslibiomp5md.dll
, see Python Pyinstaller 3.1 Intel MKL FATAL ERROR: Cannot load mkl_intel_thread.dll and cx_freeze converted GUI-app (tkinter) crashes after pressing plot-Button.Once you have found out which file(s) need(s) to be manually copied, you can let
cx_Freeze
include the necessary file(s) by using theinclude_files
list of thebuild_exe
options (see code snippet below). If necessary, you can use a tuple(source, destination)
as item in theinclude_files
list to letcx_Freeze
copy a file fromsource
to a specificdestination
into the build directory, see thecx_Freeze
documentation.I see further potential problems in the setup script you've posted in your question:
- include the whole
numpy
packages using thepackages
list of thebuild_exe
options, it is easier and maybe safer - it is safer to dynamically find out the location of the TCL/TK DLLs
- for
cx_Freeze
5.1.1, the TCL/TK DLLs need to be included in alib
subdirectory of the build directory
- include the whole
In summary, try t o use
PYTHON_INSTALL_DIR = os.path.dirname(os.path.dirname(os.__file__))
os.environ['TCL_LIBRARY'] = os.path.join(PYTHON_INSTALL_DIR, 'tcl', 'tcl8.6')
os.environ['TK_LIBRARY'] = os.path.join(PYTHON_INSTALL_DIR, 'tcl', 'tk8.6')
build_exe_options = {'packages': ['numpy'],
'includes': ['matplotlib.backends.backend_tkagg'],
'include_files': [(os.path.join(PYTHON_INSTALL_DIR, 'DLLs', 'tcl86t.dll'),
os.path.join('lib', 'tcl86t.dll')),
(os.path.join(PYTHON_INSTALL_DIR, 'DLLs', 'tk86t.dll'),
os.path.join('lib', 'tk86t.dll'))
# add here further files which need to be included as described in 1.
]}
in your setup script.