Created
July 20, 2016 12:19
-
-
Save stlehmann/26d68ce0878fe91c8d1738c482232697 to your computer and use it in GitHub Desktop.
PyInstaller hook for numpy (Windows)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from PyInstaller import log as logging | |
from PyInstaller import compat | |
from os import listdir | |
libdir = compat.base_prefix + "/Lib/site-packages/numpy/core" | |
mkllib = filter(lambda x: x.startswith('mkl_'), listdir(libdir)) | |
other_libs = ['libiomp5md.dll'] | |
if mkllib != []: | |
logger = logging.getLogger(__name__) | |
logger.info("MKL installed as part of numpy, importing that!") | |
binaries = [(os.path.join(libdir, lib), '') for lib in mkllib] | |
binaries += [(os.path.join(libdir, lib), '') for lib in other_libs] | |
if __name__ == '__main__': | |
for f in binaries: | |
print(f) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment