具体原因经过我多次尝试,猜测是libzbar-64.dll依赖的一个dll系统找不到,所以一直报错。我安装卸载重复了好几次,都不行。
最后还在python 3.6上试了下也不行,遂放弃,寻找下一个方法吧
import ctypes
sys.path.append(r'D:\Apps\anaconda2.5.2.0\Lib\site-packages\pyzbar')
dll=ctypes.cdll.LoadLibrary('libzbar-64.dll')
Traceback (most recent call last):
File "D:\Apps\anaconda2.5.2.0\lib\site-packages\IPython\core\interactiveshell.py", line 2878, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "", line 1, in
dll=ctypes.cdll.LoadLibrary('libzbar-32.dll')
File "D:\Apps\anaconda2.5.2.0\lib\ctypes\__init__.py", line 444, in LoadLibrary
return self._dlltype(name)
File "D:\Apps\anaconda2.5.2.0\lib\ctypes\__init__.py", line 366, in __init__
self._handle = _dlopen(self._name, mode)
WindowsError: [Error 126]