Could not find module '.../libtorchaudio_ffmpeg.pyd' | RuntimeError: StreamReader requires FFmpeg extension which is not available.

Windows中使用torchaudio.io.StreamReader时报错:

FileNotFoundError: Could not find module 'D:\software\miniconda3\envs\pytorch\Lib\site-packages\torchaudio\lib\libtorchaudio_ffmpeg.pyd' (or one of its dependencies). Try using the full path with constructor syntax.

RuntimeError: StreamReader requires FFmpeg extension which is not available. Please refer to the stacktrace above for how to resolve this.

提示libtorchaudio_ffmpeg.pyd这个东西找不到,但是查看目录里明明是有的

我的解决方案

https://anaconda.org/conda-forge/ffmpeg

执行以下任意一条命令

conda install conda-forge::ffmpeg
conda install conda-forge/label/broken::ffmpeg
conda install conda-forge/label/cf201901::ffmpeg
conda install conda-forge/label/cf202003::ffmpeg
conda install conda-forge/label/gcc7::ffmpeg

参考

Torchaudio fails to find FFmpeg when installed via poetry #3195
TorchAudio does not pick up ffmpeg #3016
试图本地运行时出现DEBUG:torchaudio._extension:Failed to initialize ffmpeg bindings #144

posted @   junlin623  阅读(458)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 分享 3 个 .NET 开源的文件压缩处理库,助力快速实现文件压缩解压功能!
· Ollama——大语言模型本地部署的极速利器
· 使用C#创建一个MCP客户端
· 分享一个免费、快速、无限量使用的满血 DeepSeek R1 模型,支持深度思考和联网搜索!
· Windows编程----内核对象竟然如此简单?
历史上的今天:
2023-04-30 如何给正在运行的docker容器添加端口映射
2023-04-30 制作一个包含Centos7+Nginx+Mysql8+JDK8的Docker镜像
点击右上角即可分享
微信分享提示