T
T
Ternick2018-08-12 15:30:10
Python
Ternick, 2018-08-12 15:30:10

Can't compile python script (import cv2)?

The simplest code:

import cv2

cap = cv2.VideoCapture(0)
for i in range(30):
  cap.read()
ret, frame = cap.read()
cv2.imwrite('cam.png', frame)
cap.release()

I usually compile cx_freeze )
Script for compilation :
from cx_Freeze import setup, Executable

executables = [Executable("rec_scr.py", base='Win32GUI')]
options = {
    'build_exe': {
        'include_msvcr': True,
        'build_exe': 'build_windows',
    }
}

setup(name = "TT",
      version = "1.0",
      description = "TT",
      executables=executables,
    options=options)

Here is the error: I
image05dc0f5380f39966.png
specially compile so that there is no cmd )

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
Ternick, 2018-08-13
@Ternick

Everything ! Topic closed I compiled with pyinstaller !

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question