0
votes

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.

1
py2exe is very hit and missWhatsThePoint
Unfortunately, until now I've had much more success with it than with pyinstaller. Going to give cx_freeze a try.lf345678
IMHO they're all hit an miss, i tried all 3 to build an exe of an app that had 0 imports, none of them actually wanted to build successfully, eventually i gave up on that oneWhatsThePoint
Similar behaviour was present in this case, exe-creation and numpy related crashes: stackoverflow.com/q/34806650/5781248J.J. Hakala
Thanks for the link, that does sound like the same symptom. However, the DLLs it says to import in the solution I've already been manually importing (that solved an earlier error). However, that does seem to indicate that there may be a missing DLL that isn't throwing an import error flag that's the root cause of the issue.lf345678

1 Answers

0
votes

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.