numpy dlls

This commit is contained in:
Frank 2017-07-26 19:21:21 -04:00
parent b48f04e89c
commit b5f7057506
1 changed files with 13 additions and 0 deletions

View File

@ -23,6 +23,7 @@ class SetupWin(Setup):
py2exe.build_exe.isSystemDLL = isSystemDLL
def setup(self):
self.numpy_dll_paths_fix()
config = self.config.get_section("setup")
windows = [{}]
if config["init-script"]:
@ -36,6 +37,18 @@ class SetupWin(Setup):
self.copy_data_files()
self.create_archive()
# https://stackoverflow.com/questions/36191770/py2exe-errno-2-no-such-file-or-directory-numpy-atlas-dll
def numpy_dll_paths_fix(self):
import numpy
import sys
paths = set()
np_path = numpy.__path__[0]
for dirpath, _, filenames in walk(np_path):
for item in filenames:
if item.endswith('.dll'):
paths.add(dirpath)
sys.path.append(*list(paths))
def copy_data_files(self):
root = self.config.get("setup", "windows-dist-path")
for path in chain(*zip(*self.build_data_map())[1]):