[Bug]: Clean install cannot import audio_separator — ModuleNotFoundError: No module named 'audioread' (undeclared dependency)

未关闭 适合新手
#325 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
1/5
预计耗时
1 小时以内
新手友好度
95/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
python
领域
build-system

调研方向

从 pyproject.toml 开始,其中声明了运行时依赖项,并检查 audio_separator/separator/uvr_lib_v5/spec_utils.py 和 audio_separator/separator/architectures/vr_separator.py 中的导入。明确声明 audioread,然后在干净的环境中运行 pip install --ignore-installed .,接着运行 python -c "import audio_separator" 进行验证。全新安装能够解析 audioread 且导入时没有 ModuleNotFoundError,即视为完成。

由索引模型根据 Issue 内容生成。

描述

  • I have searched and found no existing issues.

Describe the bug

A clean install of audio-separator==0.48.0 cannot be imported at all:

ModuleNotFoundError: No module named 'audioread'

audioread is imported and used at runtime, but it is not declared as a dependency. It used to arrive transitively through librosa, and librosa 1.0 dropped it, so the librosa>=0.10 constraint no longer guarantees its presence.

I confirmed this without installing anything, by resolving a fresh install:

$ pip install --dry-run --ignore-installed --report resolve.json "audio-separator==0.48.0"
$ python -c "import json;d=json.load(open('resolve.json'));p={i['metadata']['name'].lower():i['metadata']['version'] for i in d['install']};print(p.get('librosa'), 'audioread' in p)"
1.0.1 False

So the default resolution today picks librosa 1.0.1 and installs no audioread — the package is broken out of the box, no upgrade step needed.

It is not a dead import

audioread is really used, so removing the import is not the right fix:

  • audio_separator/separator/uvr_lib_v5/spec_utils.py:1 — import audioread, used at line 1332: with audioread.audio_open(audio_file) as f:
  • audio_separator/separator/architectures/vr_separator.py:12 — import audioread, used at line 397

The import chain that triggers it first:

separator/separator.py:27   from audio_separator.separator.ensembler import Ensembler
separator/ensembler.py:3    from audio_separator.separator.uvr_lib_v5 import spec_utils
uvr_lib_v5/spec_utils.py:1  import audioread
Workaround
pip install audioread

After that, import and separation both work normally (verified on 4-stem separation).

Suggested fix

Add it explicitly to dependencies in pyproject.toml, e.g. audioread>=3.0. Because librosa>=1.0 no longer provides it, relying on the transitive path will break for every new install from now on.

Logs

Traceback (most recent call last):
  File "/path/to/site-packages/audio_separator/separator/separator.py", line 27, in <module>
    from audio_separator.separator.ensembler import Ensembler
  File "/path/to/site-packages/audio_separator/separator/ensembler.py", line 3, in <module>
    from audio_separator.separator.uvr_lib_v5 import spec_utils
  File "/path/to/site-packages/audio_separator/separator/uvr_lib_v5/spec_utils.py", line 1, in <module>
    import audioread
ModuleNotFoundError: No module named 'audioread'

Package metadata for 0.48.0 shows no audioread requirement anywhere, including extras:

$ python -c "import importlib.metadata as m;print([r for r in m.requires('audio-separator') if 'audio' in r.lower()])"
['audioop-lts (>=0.2.1) ; python_version >= "3.13" and python_version < "4.0"']

System Info

Operating System: macOS 26.6.2 (arm64, Apple Silicon)
Python version:   3.14.6
audio-separator:  0.48.0 (latest on PyPI, released 2026-10-29)
librosa:          1.0.1
numpy:            2.5.5
torch:            2.15.0 (darwin arm64 wheel)
Install method:   pip in a virtualenv, as a dependency of a desktop app

Additional Information

Found while installing a third-party app that depends on audio-separator[cpu]; the failure is in this package's own dependency metadata, so it should affect any consumer, not just that app.

If 3.14 support is a concern, note requires_python currently allows 3.14.x (!=3.14.1,>=3.10) — but this failure is unrelated to the Python version, it is the missing dependency.

Happy to test a patch release.

主要语言
Python
星标
1.5k
派生
216
平均合并
1 小时
30 天内合并 PR
2

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

nomadkaraoke/python-audio-separator 的其他 Issue

查看 nomadkaraoke/python-audio-separator 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。