首页 > 编程语言 >Python报错:pkg-config could not find libraries ['avformat', 'avcodec', 'av

Python报错:pkg-config could not find libraries ['avformat', 'avcodec', 'av

时间:2023-12-13 10:00:51浏览次数:60  
标签:__ amd64 Python win avformat 报错 build av 2.7

参考:

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:

Python报错:pkg-config could not find libraries [

 

 

 

 

 

 

 

 

 

 

 

 

 

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

 

标签:__,amd64,Python,win,avformat,报错,build,av,2.7
From: https://blog.51cto.com/u_15642578/8798284

相关文章

  • Python学习多线程、多进程、多协程记录
    一、多线程应用于请求和IO#1.Python中关于使用多线程多进程的库/模块#2.选择并发编程方式(多线程Thread、多进程Process、多协程Coroutine)前置知识: 一、三种有各自的应用场景 1.一个进程中可以启动多个线程 2.一个线程中可以启动多个协程 二、各自优缺点 1......
  • Python各种奇奇怪怪的写法以及常用案例
    工具类common#####工具类commonimportrequestsimporttimeimportjsonimportrandomimportosfromlxmlimportetreeimportconcurrent.futuresfromurllib.parseimportunquote,quotefromPILimportImagedefstrClear_v1(str):try:returnst......
  • Django runserver 时报错 [Errno 11001] getaddrinfo failed
    现象描述:python使用Django命令pythonmanage.pyrunserver0:8000时,在浏览器登录遇到错误[Errno11001]getaddrinfofailed错误:解决办法:查看本机ip地址(windows在cmd中输入ipconfig可查看本机ip)打开Django项目的settings.py文件,在ALLOWED_HOSTS=[]中填入查......
  • 故障解析丨导入字符串NULL导致主从报错
    1.背景概述目前需要搭建一个从库,由于单表数据量较大,时间比较有限,考虑到导入导出的时间,并且GreatSQL支持并行loaddata的功能,能够加速数据的导入,因此决定使用selectintooutfile和loaddata的方式进行数据的迁移;在数据导入完成后进行数据同步,从库发生报错1032找不到记录,但......
  • 用python实现电子公文传输系统中遇到的数据库连接问题
    在实现电子公文传输系统时,数据库连接是一个重要的问题。Python中有多种库可以用于数据库连接,比如SQLite、MySQL、PostgreSQL等。下面是一个简单的示例,演示如何使用Python连接MySQL数据库:importmysql.connector#连接数据库conn=mysql.connector.connect(host="localhos......
  • python 报错应对列表
    =========================RESTART:D:/Python37/ziti1.py========================Traceback(mostrecentcalllast):File"D:/Python37/ziti1.py",line1,in<module>importdocxModuleNotFoundError:Nomodulenamed'docx'>>......
  • python123——西游记相关的分词,出现次数最高的20个
       #统计西游记人物出场次数,(去除冠词,代词等干扰)并降序排列p173importjiebaexcludes={"一个","那里","怎么","我们","不知","两个","甚么","不是","只见","原来","如何","这个","不曾&q......
  • python hash
    python中的hash我的博客程序源码原书:《Python全栈安全》这里使用python3.8,使用哈希函数计算消息的摘要信息,得到其哈希值(散列值)。在python下可以使用如下语句得到消息的哈希值:message='message'hash(message)哈希具有如下特性:确定性,相同的消息使用同一个哈希函数......
  • 深入解析Python网络编程与Web开发:urllib、requests和http模块的功能、用法及在构建现
     网络和Web开发是Python中不可或缺的重要领域,而其核心模块如urllib、requests和http在处理网络请求、HTTP请求和响应以及Web开发中扮演着关键的角色。这些模块为开发者提供了丰富的工具,使其能够灵活处理网络通信、构建Web应用和与远程服务器进行交互。深入了解这些模块的用法和作......
  • Python高级之闭包函数
    闭包函数【一】闭包函数的定义闭包(Closure)是指在函数内部定义的函数,并且这个内部函数可以访问外部函数的变量。这种机制允许函数保留对它创建时可见的变量的访问权,即使在其生命周期结束后也可以使用。闭包的主要特点是:内部函数定义在外部函数内部。内部函数可以引用外部函数......