I get a numpy.core.multiarray failed to import
error whenever I try to build an exe file using cx_Freeze.
My system uses the following versions:
If this can help you, I managed to make a working example under Linux using SimpleCV with the following configuration:
python 2.7.12
SimpleCV 1.3
numpy 1.11.0
cx_Freeze 5.1.1
The example code cv2_example.py
is:
import encodings
import cv2
print cv2.__version__
i = 333
print i
The setup script setup.py
is:
from cx_Freeze import setup, Executable
build_exe_options = {'packages': ['numpy']}
exe = Executable(script='cv2_example.py', base=None)
setup(name='cv2_example',
version='1.0',
executables=[exe],
options={'build_exe': build_exe_options})
I guess this example could work also for your configuration with python 3.6.0 and numpy 1.11.0 provided you upgrade cx_Freeze to version 5.1.1.
I managed to make this work only after I uninstalled cx_Freeze and installed Pyinstaller instead. It works like a charm.