# -*- mode: python coding: utf-8 -*- # freeze the python application into a stand-alone executable # https://www.pyinstaller.org/ # usage: # pyinstaller -y visualstock.spec import sys import os import shutil block_cipher = None a = Analysis( ["../app/main.py"], pathex = ["./"], binaries = [ #("../python/*.dll", "./"), ], datas = [ #("../app/config/", "config"), #("../app/data/", "data"), #("../app/script/", "script"), ], hiddenimports = ["numpy.core.multiarray"], hookspath = [], runtime_hooks = [], excludes = [ "astroid", "astropy", "babel", "bcolz", "bcrypt", "black", "blib2to3", "blosc", "bokeh", "boto3", "botocore", "bottleneck", "branca", #"certifi", "contourpy", "coverage", "cryptography", "cv2", "cvxopt", "cytoolz", "Cython", "dask", "distributed", "django", "docutils", "duckdb", "erfa", "greenlet", "h5py", "jedi", "jsonschema", "markupsafe", "matplotlib", "nacl", "netCDF4", "netcdftime", "notebook", "numexpr", "parso", "PIL", "psutil", "pyarrow", "pydantic", "pymongo", "PyQt5", "Pythonwin", #"pytz", #"regex", "scikit-image", "scikit-learn", "scipy", "sphinx", "sqlalchemy", "tables", #"tcl", "tcl8", #"tk", "torch", "torchaudio", "torchvision", "tornado", "msgpack", "nbconvert", "nbformat", "simplejson", #"win32", "win32com", "wx", "zmq", "zope", ], win_no_prefer_redirects = False, win_private_assemblies = False, cipher = block_cipher, noarchive = False ) custom_exclude = [ "mkl_avx.dll", "mkl_avx2.dll", "mkl_avx512.dll", #"mkl_core.dll", #"mkl_def.dll", #"mkl_intel_thread.dll", "mkl_mc.dll", "mkl_mc3.dll", #"mkl_rt.dll", "mkl_sequential.dll", "mkl_tbb_thread.dll", "mkl_vml_avx.dll", "mkl_vml_avx2.dll", "mkl_vml_avx512.dll", "mkl_vml_cmpt.dll", "mkl_vml_def.dll", "mkl_vml_mc.dll", "mkl_vml_mc2.dll", "mkl_vml_mc3.dll", "svml_dispmd.dll", ] binaries = [] for item in a.binaries: flag = True for ptn in custom_exclude: l = len(ptn) i = item[0] if len(i) < l: continue if i[-l:] == ptn: flag = False if flag: binaries.append(item) #print(len(binaries), binaries) a.binaries = binaries pyz = PYZ( a.pure, a.zipped_data, cipher = block_cipher ) exe = EXE( pyz, a.scripts, [], exclude_binaries = True, name = "DataProcess", debug = False, bootloader_ignore_signals = False, strip = False, upx = False, console = False, #icon = "../image/visualstock.png" ) coll = COLLECT( exe, a.binaries, a.zipfiles, a.datas, strip = False, upx = True, upx_exclude = [], name = "dataprocess" )