I have this script which read bar codes from images.
from PIL import Image
import zbar
scanner = zbar.ImageScanner()
scanner.parse_config('enable')
pil = Image.open('zbartest2.png').convert('L')
width, height = pil.size
raw = pil.tostring()
image = zbar.Image(width, height, 'Y800', raw)
scanner.scan(image)
for symbol in image:
print 'decoded', symbol.type, 'symbol', '"%s"' % symbol.data
del(image)
When i put this script in python main directory which is C:\Python27 it works without any problem.
However, when i put this script outside of main directory such as C:\myscript, it gives me error saying that import zbar - module The specified module could not be found.
What is causing the problem?
I am using Python 2.7 32bits on windows Xp 32bits SP3
EDIT:
I am executing it from the IDLE window by using run module command (F5) ;full traceback
Traceback (most recent call last):
File "C:\myscript\test.py", line 2, in <module>
import zbar
ImportError: DLL load failed: The specified module could not be found.
when i type in import zbar; print zbar.__file__
i get the following msg
C:\Python27\lib\site-packages\zbar.pyd
Make sure you have all the files that you are importing in the same directory as this script