Linux arm環境下pip3安裝av失敗


報如下錯誤:
Could not find libavformat with pkg-config. Could not find libavcodec with pkg-config. Could not find libavdevice with pkg-config. Could not find libavutil with pkg-config. Could not find libavfilter with pkg-config. Could not find libswscale with pkg-config. Could not find libswresample with pkg-config.

可以對應安裝apt-get install libavformat-dev 等庫

如果編譯錯誤,可以嘗試:

root用戶下安裝步驟:
安裝ffmpeg

mkdir ffmpeg
wget http://www.ffmpeg.org/releases/ffmpeg-4.1.3.tar.gz tar -zxvf ffmpeg-4.1.3.tar.gz cd ffmpeg-4.1.3 ./configure --enable-shared --enable-pic --enable-static --disable-x86asm --prefix=/root/yuefu/ffmpeg #其中/root/yuefu/ffmpeg換成自己要安裝的路徑 make -j32 make install 
 

vi /etc/ld.so.conf.d/ffmpeg.conf
在末尾添加一行,路徑換成自己的
/root/yuefu/ffmpeg/lib
使配置生效
ldconfig

配置profile系統文件
vim /etc/profile
在末尾添加一行
export PATH=$PATH:/root/yuefu/ffmpeg/bin
使配置文件生效
source /etc/profile
使opencv能找到ffmpeg
pip3 install opencv-python
cp /root/yuefu/ffmpeg/lib/pkgconfig/* /usr/share/pkgconfig

安裝pyav

git clone https://gitee.com/mirrors/PyAV.git cd PyAV/ python3 setup.py build --ffmpeg-dir=/root/yuefu/ffmpeg python3 setup.py install 
 

測試pyav安裝是否成功
cd ..
python3
import av
注意:不要再PyAv目錄下測試,否則報錯
ModuleNotFoundError: No module named 'av._core'


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM