[Python] pyzbar 오류 해결 방법 / libzbar-64.dll 에러

2022. 9. 28. 20:502018년 이전 관심사/프로그램 언어

반응형

문제

 

아래 링크에서 발생한 문제로, 아나콘다 환경을 64bit로 변경하니, 기존 32bit 아나콘다에서 잘 사용하던 pyzbar 라이브러리에서 아래와 같이 libzbar-64.dll를 찾을 수 없다는 에러가 발생 했다.

 

https://kaizen8501.tistory.com/293

 

FileNotFoundError: Could not find module 'D:\Workspace\venv\testx_64\lib\site-packages\pyzbar\libzbar-64.dll' (or one of its dependencies). Try using the full path with constructor syntax.

(testx_64) D:\Workspace\testxStdJig_V2>python main.py
Traceback (most recent call last):
  File "D:\Workspace\venv\testx_64\lib\site-packages\pyzbar\zbar_library.py", line 58, in load
    dependencies, libzbar = load_objects(Path(''))
  File "D:\Workspace\venv\testx_64\lib\site-packages\pyzbar\zbar_library.py", line 50, in load_objects
    deps = [
  File "D:\Workspace\venv\testx_64\lib\site-packages\pyzbar\zbar_library.py", line 51, in <listcomp>
    cdll.LoadLibrary(str(directory.joinpath(dep)))
  File "D:\anaconda3_64\lib\ctypes\__init__.py", line 460, in LoadLibrary
    return self._dlltype(name)
  File "D:\anaconda3_64\lib\ctypes\__init__.py", line 382, in __init__
    self._handle = _dlopen(self._name, mode)
FileNotFoundError: Could not find module 'libiconv.dll' (or one of its dependencies). Try using the full path with constructor syntax.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\Workspace\testxStdJig_V2\main.py", line 11, in <module>
    from manager.cameraManager import CameraManager, VideoStreamerThread
  File "D:\Workspace\venv\testx_64\Lib\site-packages\shiboken2\files.dir\shibokensupport\__feature__.py", line 142, in _import
    return original_import(name, *args, **kwargs)
  File "D:\Workspace\testxStdJig_V2\manager\cameraManager.py", line 18, in <module>
    from pyzbar import pyzbar
  File "D:\Workspace\venv\testx_64\Lib\site-packages\shiboken2\files.dir\shibokensupport\__feature__.py", line 142, in _import
    return original_import(name, *args, **kwargs)
  File "D:\Workspace\venv\testx_64\lib\site-packages\pyzbar\pyzbar.py", line 7, in <module>
    from .wrapper import (
  File "D:\Workspace\venv\testx_64\Lib\site-packages\shiboken2\files.dir\shibokensupport\__feature__.py", line 142, in _import
    return original_import(name, *args, **kwargs)
  File "D:\Workspace\venv\testx_64\lib\site-packages\pyzbar\wrapper.py", line 151, in <module>
    zbar_version = zbar_function(
  File "D:\Workspace\venv\testx_64\lib\site-packages\pyzbar\wrapper.py", line 148, in zbar_function
    return prototype((fname, load_libzbar()))
  File "D:\Workspace\venv\testx_64\lib\site-packages\pyzbar\wrapper.py", line 127, in load_libzbar
    libzbar, dependencies = zbar_library.load()
  File "D:\Workspace\venv\testx_64\lib\site-packages\pyzbar\zbar_library.py", line 60, in load
    dependencies, libzbar = load_objects(Path(__file__).parent)
  File "D:\Workspace\venv\testx_64\lib\site-packages\pyzbar\zbar_library.py", line 54, in load_objects
    libzbar = cdll.LoadLibrary(str(directory.joinpath(fname)))
  File "D:\anaconda3_64\lib\ctypes\__init__.py", line 460, in LoadLibrary
    return self._dlltype(name)
  File "D:\anaconda3_64\lib\ctypes\__init__.py", line 382, in __init__
    self._handle = _dlopen(self._name, mode)
FileNotFoundError: Could not find module 'D:\Workspace\venv\testx_64\lib\site-packages\pyzbar\libzbar-64.dll' (or one of its dependencies). Try using the full path with constructor syntax.

 

해결 방법

아래 링크에서 Visual C++ 2013 버전을 받아서 설치 하니 위 문제가 해결 되었다.

https://www.microsoft.com/ko-KR/download/details.aspx?id=40784 

 

Download Visual Studio 2013용 Visual C++ 재배포 가능 패키지 from Official Microsoft Download Center

중요! 아래에서 언어를 선택하면 전체 페이지 내용이 해당 언어로 신속하게 변경됩니다. 독일어러시아어스페인어영어이탈리아어일본어중국어(간체)중국어(번체)프랑스어한국어 다운로드 Visual

www.microsoft.com

 

반응형