Python报错:pkg-config could not find libraries ['avformat', 'avcodec', 'avdevice', 'avutil', 'avfilter', 'swscale', 'swresample']
参考:
https://github.com/PyAV-Org/PyAV/issues/238
https://pyav.org/docs/6.1.2/installation.html#mac-os-x
=====================
报错信息:
C:\Users\liuxue>pip install av Collecting av Using cached av-0.3.3.tar.gz Installing collected packages: av Running setup.py install for av ... error Complete output from command d:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\liuxue\\appdata\\local\\temp\\pip-build-cq6uln\\av\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record c:\users\liuxue\appdata\local\temp\pip-8nuwew-record\install-record.txt --single-version-externally-managed --compile: running install running build running build_py creating build creating build\lib.win-amd64-2.7 creating build\lib.win-amd64-2.7\av copying av\__init__.py -> build\lib.win-amd64-2.7\av copying av\__main__.py -> build\lib.win-amd64-2.7\av creating build\lib.win-amd64-2.7\av\audio copying av\audio\__init__.py -> build\lib.win-amd64-2.7\av\audio creating build\lib.win-amd64-2.7\av\container copying av\container\__init__.py -> build\lib.win-amd64-2.7\av\container creating build\lib.win-amd64-2.7\av\filter copying av\filter\__init__.py -> build\lib.win-amd64-2.7\av\filter creating build\lib.win-amd64-2.7\av\subtitles copying av\subtitles\__init__.py -> build\lib.win-amd64-2.7\av\subtitles creating build\lib.win-amd64-2.7\av\video copying av\video\__init__.py -> build\lib.win-amd64-2.7\av\video running build_ext running reflect running config looking for avformat_open_input... missing looking for pyav_function_should_not_exist... missing looking for av_calloc... missing looking for av_frame_get_best_effort_timestamp... missing looking for avformat_alloc_output_context2... missing looking for avformat_close_input... missing looking for AVStream.index... missing looking for PyAV.struct_should_not_exist... missing looking for AVFrame.mb_type... missing We didn't find `avformat_open_input` in the libraries. We look for it only as a sanity check to make sure the build process is working as expected. It is not, so we must abort. Please open a ticket at https://github.com/mikeboers/PyAV/issues with the folowing information: PyAV: 0.3.3 Python: 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:53:40) [MSC v.1500 64 bit (AMD64)] platform: Windows-10-10.0.15063 extension_extra: libraries: ['avformat', 'avcodec', 'avdevice', 'avutil', 'avfilter', 'swscale', 'swresample'] extra_link_args: ['/OPT:NOREF'] library_dirs: ['d:\\python27\\libs', 'd:\\python27\\PCbuild\\amd64', 'd:\\python27\\PC\\VS9.0\\amd64'] include_dirs: ['include', 'd:\\python27\\include', 'd:\\python27\\PC'] config_macros: PYAV_VERSION=0.3.3 PYAV_VERSION_STR="0.3.3" PYAV_COMMIT_STR="unknown-commit" inline=__inline PYAV_HAVE_LIBSWRESAMPLE=1 ---------------------------------------- Command "d:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\liuxue\\appdata\\local\\temp\\pip-build-cq6uln\\av\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record c:\users\liuxue\appdata\local\temp\pip-8nuwew-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in c:\users\liuxue\appdata\local\temp\pip-build-cq6uln\av\
解决方法:
# General dependencies sudo apt-get install -y python-dev pkg-config # Library components sudo apt-get install -y \ libavformat-dev libavcodec-dev libavdevice-dev \ libavutil-dev libswscale-dev libswresample-dev libavfilter-dev
-----------------------------
查询Google:
=============================
本博客是博主个人学习时的一些记录,不保证是为原创,个别文章加入了转载的源地址,还有个别文章是汇总网上多份资料所成,在这之中也必有疏漏未加标注处,如有侵权请与博主联系。
如果未特殊标注则为原创,遵循 CC 4.0 BY-SA 版权协议。
posted on 2023-12-02 10:18 Angry_Panda 阅读(435) 评论(0) 编辑 收藏 举报
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· 终于写完轮子一部分:tcp代理 了,记录一下
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
2022-12-02 记一次网络举报成功案例——中央网信办举报中心
2021-12-02 视频推荐: Linux 的make自动化编译和通用makefile
2021-12-02 Linux环境下配置vscode的C/C++ 的make编译环境(编写makefile方式)
2017-12-02 转载: beta分布介绍