cx_Freeze and scipy - missing gfortran library?

185 views Asked by At

I'm using cx_Freeze to generate executables. This is a project that was working some time ago and has been dormant, so unfortunately my build env has changed (pretty much everything has updated). I'm on OS X 10.10 with python3.4.

When I try to run a frozen program, I get the following import error:

Problem loading python modules
dlopen(/Users/alex/Dropbox (Personal)/Research/Code/NIF_WRF/build/exe.macosx-10.10-x86_64-3.4/scipy.linalg._fblas.so, 2): Library not loaded: @loader_path/../.dylibs/libgfortran.2.0.0.dylib
Referenced from: /Users/alex/Dropbox (Personal)/Research/Code/NIF_WRF/build/exe.macosx-10.10-x86_64-3.4/scipy.linalg._fblas.so
Reason: image not found

libgfortran.2.0.0.dylib is in the build directory, so I'm not sure what the issue is...

1

There are 1 answers

0
Bob On

I had the same problem and it seems cx_freeze does not change the relative path imports of the shared libraries.

Library not loaded: @loader_path/../.dylibs/libgfortran.2.0.0.dylib

scipy.linalg._fblas.so wants to import ../.dylibs/libgfortran.2.0.0.dylib from a relative path but cx_Freeze puts all shared libraries in the same folder.

I wrote a bug report at the cx_freeze homepage with my current workaround. https://bitbucket.org/anthony_tuininga/cx_freeze/issues/174/problems-freezing-modules-with-relative