python - py2exe on PIL ImageStat.Stat throws Exception: argument 2 must be ImagingCore, not ImagingCore -
I am trying to create .exe from a Python program using py2exe, but when I run .exe Exception in Thread I: Traceback (most recent call final): File "threading.pyc", line 532, __bootstrap_inner file "threading.pyc", in line 484, run
In the file "webcam.py", in line 66, type "ImageStat.pyc" in the Loop file, in line 50, __init__ file "PIL \ image.pyc", line 9 9, in histogram Line: Logic2 should be imaging Here, there is some code: # webcam.py cam = VideoCapture.Device (); Def getImage (): return cam.getImage (); ... camerashot = grayscale (getImage ()); LightCoords = []; Level = camshot.getextrema () [1] - Flexibility; In camshot.getdata (): if p & gt; = Level: lightCoords.append (255); Else: lightCoords.append (0); Mask I = New ("L", Ridge); MaskIm.putdata (lightCoords); ... 64 colorcamshot = getImage (); 65 camshot = grayscale (color camera); 66 Brightness = ImageStat.Stat (camshot, masked) .sum [0] / divVal;
Before importing any worker thread, import PIL into your main thread try. It seems that the same class has been imported twice, and the results of the type are looking infrequent as the result.
Comments
Post a Comment