How to create exe from Python code using opencv with or without py2exe?

I have Python code that correctly processes its simple thing using opencv. eg

import cv2 x = cv2.imread('Dog6.jpg') cv2.imwrite('new2.jpg') 

setup.py -

 from distutils.core import setup import py2exe import cv2 setup(console=['name.py']) 

but i cannot create exe of this code with py2exe. Is there another way to create exe such a program?

ImportError error: numpy.core.multiarray failed to import

+6
source share
1 answer

Put the line:

  import numpy 

In your script, i.e. first file and try again.

+4
source

Source: https://habr.com/ru/post/946251/


All Articles