Python报错:performance hint: av/logging.pyx:232:5: the GIL to be acquired
参考:
https://stackoverflow.com/questions/77410272/problems-installing-python-av-in-windows-11
https://github.com/PyAV-Org/PyAV/issues/1177
================================
报错信息:
C:\Windows.old\Users\chris>pip install av
Defaulting to user installation because normal site-packages is not writeable
Collecting av
Using cached av-10.0.0.tar.gz (2.4 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... error
error: subprocess-exited-with-error × Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [74 lines of output]
Compiling av\buffer.pyx because it changed.
[1/1] Cythonizing av\buffer.pyx
Compiling av\bytesource.pyx because it changed.
[1/1] Cythonizing av\bytesource.pyx
Compiling av\descriptor.pyx because it changed.
[1/1] Cythonizing av\descriptor.pyx
Compiling av\dictionary.pyx because it changed.
[1/1] Cythonizing av\dictionary.pyx
Compiling av\enum.pyx because it changed.
[1/1] Cythonizing av\enum.pyx
Compiling av\error.pyx because it changed.
[1/1] Cythonizing av\error.pyx
Compiling av\format.pyx because it changed.
[1/1] Cythonizing av\format.pyx
Compiling av\frame.pyx because it changed.
[1/1] Cythonizing av\frame.pyx
performance hint: av\logging.pyx:232:5: Exception check on 'log_callback' will always require the GIL to be acquired.
Possible solutions:
1. Declare the function as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
2. Use an 'int' return type on the function to allow an error code to be returned. Error compiling Cython file:
------------------------------------------------------------
...
cdef const char *log_context_name(void *ptr) nogil:
cdef log_context *obj = <log_context*>ptr
return obj.name cdef lib.AVClass log_class
log_class.item_name = log_context_name
^
------------------------------------------------------------ av\logging.pyx:216:22: Cannot assign type 'const char *(void *) except? NULL nogil' to 'const char *(*)(void *) noexcept nogil'. Exception values are incompatible. Suggest adding 'noexcept' to type 'const char *(void *) except? NULL nogil'. Error compiling Cython file:
------------------------------------------------------------
... # Start the magic!
# We allow the user to fully disable the logging system as it will not play
# nicely with subinterpreters due to FFmpeg-created threads.
if os.environ.get('PYAV_LOGGING') != 'off':
lib.av_log_set_callback(log_callback)
^
------------------------------------------------------------ av\logging.pyx:351:28: Cannot assign type 'void (void *, int, const char *, va_list) except * nogil' to 'av_log_callback'. Exception values are incompatible. Suggest adding 'noexcept' to type 'void (void *, int, const char *, va_list) except * nogil'.
Compiling av\logging.pyx because it changed.
[1/1] Cythonizing av\logging.pyx
Traceback (most recent call last):
File "C:\Program Files\Python312\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
main()
File "C:\Program Files\Python312\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Python312\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 118, in get_requires_for_build_wheel
return hook(config_settings)
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-4nz2e7u1\overlay\Lib\site-packages\setuptools\build_meta.py", line 355, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=['wheel'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-4nz2e7u1\overlay\Lib\site-packages\setuptools\build_meta.py", line 325, in _get_build_requires
self.run_setup()
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-4nz2e7u1\overlay\Lib\site-packages\setuptools\build_meta.py", line 507, in run_setup
super(_BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script)
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-4nz2e7u1\overlay\Lib\site-packages\setuptools\build_meta.py", line 341, in run_setup
exec(code, locals())
File "<string>", line 157, in <module>
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-4nz2e7u1\overlay\Lib\site-packages\Cython\Build\Dependencies.py", line 1154, in cythonize
cythonize_one(*args)
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-4nz2e7u1\overlay\Lib\site-packages\Cython\Build\Dependencies.py", line 1321, in cythonize_one
raise CompileError(None, pyx_file)
Cython.Compiler.Errors.CompileError: av\logging.pyx
[end of output] note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error × Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output. note: This error originates from a subprocess, and is likely not a problem with pip. [notice] A new release of pip is available: 23.2.1 -> 23.3.1
[notice] To update, run: python.exe -m pip install --upgrade pip
解决方法:
网上给出的解决方法:
1.
The problem is not Windows 11. The problem lies within python 3.12
. The package av
is not yet released for python 3.12
.
Please try to install av
under python 3.11
.
2.
I had the same issue and switching from Python 3.12.0 to 3.11.6 solved it for me
------------------------------
个人实测的成功解决方法:
把Python的版本从Python 3.11降到Python 3.10,不再报错,成功解决。
============================
查询Google:
Python报错:performance hint: av/logging.pyx:232:5: the GIL to be acquired的更多相关文章
- Python报错总结丶自定义报错
Python报错总结: 常见异常 1,NameError: name 'a' is not defined:未定义函数名 2,IndentationError: uninden ...
- Python报错module 'scipy.misc' has no attribute 'xxx'
Python报错module 'scipy.misc' has no attribute 'imresize' 解决办法: 安装Pillow包,命令如下: pip install Pillow 然后重 ...
- selenium python 报错“ unable to find binary in default location”
selenium python 报错如下: raise exception_class(message, screen, stacktrace)selenium.common.exceptions.W ...
- 解决Python报错:local variable 'xxx' referenced before assignment(引)
解决Python报错:local variable 'xxx' referenced before assignment(引) 解决Python报错:local variable 'xxx' refe ...
- python 报错 wxPyDeprecationWarning: Using deprecated class PySimpleApp.
如题:python 报错 提示为 : wxPyDeprecationWarning: Using deprecated class PySimpleApp. 解决:将 wx.PySimpleApp() ...
- PyCharm 中文 字符 python 报错 的 完美 解决方案!
PyCharm 中文 字符 python 报错 的 完美 解决方案! #_*_ coding:utf-8_*_ https://www.python.org/dev/peps/pep-0263/ 到p ...
- Python报错ModuleNotFoundError: No module named 'numpy'
转载:https://blog.csdn.net/qq_39779233/article/details/103224712 Python报错ModuleNotFoundError: No modul ...
- 【git报错】hint: Updates were rejected because the tip of your current branch is behind
有时候作为非master权限的项目参与者 在push的时候会遇到这样的报错: hint: Updates were rejected because the tip of your current b ...
- Python报错UnicodeDecodeError: ascii codec can t decode byte 0xe0 ...解决方法
用命令(python setup.py install)安装webpy时候总是报错 在网上搜索到的解决方法如下: 1. 这是Python 2 mimetypes的bug 2. 需要将Python2.7 ...
- 新手常见的python报错及解决方案
此篇文章整理新手编写代码常见的一些错误,有些错误是粗心的错误,但对于新手而已,会折腾很长时间才搞定,所以在此总结下我遇到的一些问题.希望帮助到刚入门的朋友们.后续会不断补充. 目录 1.NameErr ...
随机推荐
- 小米 红米 Redmi MIUI14 ANDROID 系统 耗电
小米 红米 Redmi MIUI14 ANDROID 系统 耗电 在系统更新里,点右上角三点,下载完整更新包,安装好.再把电量用到关机,充电,充满开机,别拔线,继续充10分钟.我就是这么解决的,今天用 ...
- ASP.NET MVC 查询加分页
使用了LinqKit.PagedList.Mvc.EntityFramework 等DLL 直接使用nuget安装即可. 1.表模型: using System.ComponentModel.Data ...
- 漫画图解 Go 并发编程之:Channel
当谈到并发时,许多编程语言都采用共享内存/状态模型.然而,Go 通过实现 Communicating Sequential Processes(CSP)而与众不同.在 CSP 中,程序由不共享状态的并 ...
- MySql 中 select 使用
MySql select 多种查询方式 前言 在数据库使用过程中,使用最多的场景就是查询数据,所以今天我们总结一下常用用的查询 简单查询 带条件查询 多条件查询 输出指定字段查询 分组查询 查询结果排 ...
- 什么是浅拷贝和深拷贝,如何用 js 代码实现?
〇.简介和对比 简介 浅拷贝:只复制原始对象的第一层属性值. 如果属性值是值类型,将直接复制值,本值和副本变更互不影响: 如果是引用数据类型,则复制内存地址,因此原始对象和新对象的属性指向相同 ...
- 配置pod拉取harbor容器镜像仓库私有镜像:secret保存账号密码
目录 一.系统环境 二.前言 三.Docker-Registry类型的Secret简介 四.镜像仓库简介 五.搭建Harbor容器镜像仓库 5.1 安装Harbor 5.2 创建项目 5.3 推送镜像 ...
- 实训day2
HTML基本介绍 编辑网页的语言,超文本标记语言,是迄今为止网络上应用最为广泛的语言,也是抱成网页文档的主要语言.HTML文本是由HTML命令组成的描述性文本,HTML命令可以说明文字.图形.动画.声 ...
- Linux 内核:设备树(1)dtb格式
Linux 内核:设备树(1)dtb格式 背景 dtb作为二进制文件被加载到内存中,然后由内核读取并进行解析,如果对dtb文件的格式不了解,那么在看设备树解析相关的内核代码时将会寸步难行,而阅读源代码 ...
- 高通安卓:androidboot.mode参数控制系统流程原理
高通安卓:androidboot.mode参数控制系统流程原理 参考:https://blog.csdn.net/guofeizhi/article/details/106644773 背景 在做出厂 ...
- FFmpeg开发笔记(三十四)Linux环境给FFmpeg集成libsrt和librist
<FFmpeg开发实战:从零基础到短视频上线>一书的"10.2 FFmpeg推流和拉流"提到直播行业存在RTSP和RTMP两种常见的流媒体协议.除此以外,还有比较两 ...