Create executable file for application using opencv?

I developed a small Python application on Windows that uses opencv. I am trying to create an executable so that anyone can install and use it, without having to install python / opencv / numpy.,

I tried using py2exe for this. It actually creates the .exe file, although I have a warning during build:

*** copy dlls ***
copying C:\Windows\system32\MSVFW32.dll -> 
...
The following modules appear to be missing
['cv2.cv']

When I try to run the .exe file using the command line, I see a message:

ImportError: numpy.core.multiarray failed to import

My setup.py file is pretty simple:

# creating executable here
from distutils.core import setup
import py2exe, sys, os

sys.argv.append('py2exe')

setup(
    options = {'py2exe': {'bundle_files': 1}},
    console=['facemovie.py'],
    zipfile = None,
)

Any idea how I can solve this? This is the first time I want to deploy, and I can miss something.

Thank!

+5
source share
4 answers

Thanks, karlphilip, you put me on the tracks.

" ", py2exe.

, opencv , , .

, : options = {'py2exe': {'bundle_files': 1, 'includes': 'numpy'}},

, .

, , .

.

+2

PyInstaller. , pycrypto, , .

+3

py2exe , ZIP-. , , :

python setup.py py2exe -p cv2

setup.py :

options = {'py2exe': {'bundle_files': 1, 'packages': 'cv2' } },

- , bbfreeze:

python

+2

. , , . py2exe, pyinstaller.

0

All Articles