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:

 

 

 

 

 

 

 

 

 

 

 

 

 

=============================

 

posted on   Angry_Panda  阅读(435)  评论(0编辑  收藏  举报

编辑推荐:
· 基于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分布介绍

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

点击右上角即可分享
微信分享提示