0
0

pyzbarでlibiconv.dllが見つからないエラー

Posted at

エラー内容

Pythonにpyzbarをインストールして、実行したがDLLが見つからないとエラーが出る。

FileNotFoundError: Could not find module 'libiconv.dll' (or one of its dependencies). Try using the full path with constructor syntax.

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

解決策

Microsoft公式から、Viaual C++ 2013 再配布パッケージをダウンロードして、インストールする。

64bit版なら、ファイル名「vcredist_x64.exe」。

原因

見つからないとエラーが出ているlibiconv.dllとlibzbar-64.dllは両方ともpyzbarをインストールしたときに、pyzbarフォルダーに既にインストールされている(site-packages/pyzbar以下にある)。

また、Viaual C++ 2013 再配布パッケージには、libiconv.dllもlibzbar-64.dllも同梱されていない。
※パッケージをインストールする前にも、libiconv.dllとlibzbar-64.dllは、windowsフォルダ以下に配置されていない(検索しても無い)。

ただし、libiconv.dllもlibzbar-64.dllも再配布パッケージに入っているライブラリ(msvcp140.dll、vcruntime140.dll)がないと動かない。

つまり、当初ファイルが見つかりませんと出ていたエラーは、「libiconv.dllやlibzbar-64.dll(を動かすファイル)が見つかりません」と言っていることを実質的に示しており、混乱をまねくこととなった。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0