0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

pyzbar で `FileNotFoundError: Could not find module 'libiconv.dll'` が出た時の対処法

0
Last updated at Posted at 2026-05-26

発生した状況

Windows で pyzbar をインストールして実行したところ、以下の2つのエラーが連続して発生した。

1つ目:

FileNotFoundError: Could not find module 'libiconv.dll'

2つ目:

FileNotFoundError: Could not find module '...\pyzbar\libzbar-64.dll'

原因

pyzbar が内部で使っている C ライブラリ(libzbar)を動かすのにWindows の Visual C++ ランタイム が必要だが、それがパソコンに入っていないことが原因らしい。

環境

項目 内容
OS Windows 11(64bit)
Python 3.13
発生ライブラリ pyzbar 0.1.9

解決方法

Visual C++ 再頒布可能パッケージを入れる

  1. 以下の Microsoft 公式ページからインストーラーをダウンロードする。
    Visual Studio 2013 の Visual C++ 再頒布可能パッケージ

  2. 一覧から vcredist_x64.exe(64bit用)を選択してダウンロードする。

  3. ダウンロードした vcredist_x64.exe をダブルクリックしてインストールする。

  4. インストール完了後、再度スクリプトを実行する。

    python pyzbar.py
    

まとめ

原因は pyzbar が依存するVisual C++ ランタイムが Windows に入っていなかっただけでした。
Visual C++ 再頒布可能パッケージ(vcredist_x64.exe)を公式からインストールしたら、コードは一切変えずにあっさり動きました。

この記事が少しでもお役に立てれば幸いです。
ご意見・ご感想などがありましたら、お気軽にコメントいただけると嬉しいです。


参考

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?