I got this error "Failed to excute script camera". [closed]
Hello fellows, I have problem with building python code that has opencv imported in it, the error message when I run app is "Failed to excute script camera" (it is a desktop app). Below is my code, can you try to build it as exe file and run?
import cv2
cap = cv2.VideoCapture(0)
while(True):
ret, frame = cap.read()
rgb = cv2.cvtColor(frame, cv2.COLOR_BGR2BGRA)
cv2.imshow('frame', rgb)
if cv2.waitKey(1) & 0xFF == ord('q'):
out = cv2.imwrite('capture.jpg', frame)
break
cap.release()
cv2.destroyAllWindows()
Thank in advance!!!!!!!!!!
the code you show cannot throw the error in the title, so there must be more / something else ?
how do you actually try to run it ?
I meant after building the code and run the application it shows that error. Can you try to build that code i pasted above?
I have that code above and now I use PyInstaller to convert it to .exe file to run it on Windows. Application in my opinion means the app (.exe file) created after converting.
opencv is not in the list
@Son Le -- there are a couple of posts, trying to use PyInstaller -- none of them with any success.
do you absolutely have to use it ? it looks like an unnessecary complication (since you also seem to be quite new to all of this)
What I need is to convert my code to .exe file with opencv included. I can try other but I dont know anything else but PyInstaller. Do you have any suggestion?
@LBerger: what list please?
@Son Le -- advice: forget the idea.
those installers work nicely with pure python code, but opencv is mainly a c++ library, all the code is inside cv2.pyd/so, and you won't ever get something really portable.
also, all of this is quite off-topic, imho.