Python py2exe executable silent crash with scipy.linalg or numpy.linalg
I managed to solve this problem and wanted to post the solution.
The link posted by J.J. Hakala, showed that an error with the same symptoms can occur with matplotlib because py2exe does not transfer some necessary dll's to the new dist directory. I was already transferring the dll's mentioned in that post manually, however by manually testing I discovered that mkl_avx.dll was also necessary for numpy.linalg. By simply copying this to the dist directory this problem was resolved.
I've been using py2exe to package some scripts as executable, which has worked well until this error.
In one script I need to solve a straightforward system of linear equations. I've been doing this with scipy.linalg.lstsq.
The problem is that any script I package with any scipy.linalg or numpy.linalg command crashes as soon as it gets to that line. The executable compiles with no errors. Everything runs as it should until it gets to a linalg command, then the executable just closes with no warning or error. No error log gets written.
I've confirmed that it's always the linalg commands by manually writing log files with flags around the commands.
I've used other scipy packages, primarily optimize, before with no issues.
I've tried catching the error with a 'try' statement, but it crashes regardless.
I can only think it's some kind of import error, but those normally throw errors when the executable is being built.
The complete lack of any error or warning messages has me at a loss as to what could be causing this.