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'
联系方式:emhhbmdfbGlhbmcxOTkxQDEyNi5jb20=
分类:
python
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· DeepSeek 开源周回顾「GitHub 热点速览」
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
2021-03-03 Leetcode 39. 组合总数(1 2) tag 数组 回溯法
2021-03-03 Leetcode 35.搜索插入位置 tag 数组
2017-03-03 Android四大组件的生命周期
2017-03-03 Android中View绘制流程以及invalidate()等相关方法分析(转)