ImportError:libavcodec.so.56:共有オブジェクトファイルを開くことができません:そのファイルまたはディレクトリがありません。

ImportError:libavcodec.so.56:共有オブジェクトファイルを開くことができません:そのファイルまたはディレクトリがありません。

pacmanを使用してopencvをインストールしましたが、opencvをインポートしようとすると、次のエラーが発生します。

>>> import cv2
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: libavcodec.so.56: cannot open shared object file: No such file or directory

このエラーをどのように解決できますか?

編集する

sudo pacman -Ss libav
extra/gst-libav 1.4.4-1 [installed: 1.4.1-1]
    Gstreamer libav Plugin
extra/libavc1394 0.5.4-2 [installed]
    A library to control A/V devices using the 1394ta AV/C commands.
community/ffms2 2.20-2 [installed]
    A libav/ffmpeg based source library and Avisynth plugin for easy frame
    accurate access

ベストアンサー1

これは正しいライブラリがインストールされていないことを意味します。を使って検索してみてくださいpacman -Ss libav

OpenSuSEでは、この部分libavcodec52ffmpegatがインストールされていffmpegて依存関係があることを確認してください。しなければならないlibavcodecをドラッグします。

編集する

アーチを読んだ後文書ffmpeg、要件を提供しているようですlibavcodec

おすすめ記事