#1364 RuntimeError: Numpy is not available

106.180* Posted at: 1 day ago 👁12

语音识别阶段出错:[openai-whisper(本地)] 运行时错误:Numpy is not available:
Traceback (most recent call last):
File "/Users/nine/pyvideotrans/videotrans/task/job.py", line 107, in run

trk.recogn()

File "/Users/nine/pyvideotrans/videotrans/task/_speech2text.py", line 133, in recogn

raw_subtitles = run(

File "/Users/nine/pyvideotrans/videotrans/recognition/__init__.py", line 195, in run

return OpenaiWhisperRecogn(**kwargs).run()

File "/Users/nine/pyvideotrans/videotrans/recognition/_base.py", line 78, in run

return self._exec()

File "/Users/nine/pyvideotrans/videotrans/recognition/_openai.py", line 46, in _exec

model = whisper.load_model(

File "/Users/nine/pyvideotrans/venv/lib/python3.10/site-packages/whisper/__init__.py", line 154, in load_model

model.set_alignment_heads(alignment_heads)

File "/Users/nine/pyvideotrans/venv/lib/python3.10/site-packages/whisper/model.py", line 251, in set_alignment_heads

mask = torch.from_numpy(array).reshape(

RuntimeError: Numpy is not available


=
system:macOS-15.7.1-x86_64-i386-64bit
version:v3.84
frozen:False
language:zh
root_dir:/Users/nine/pyvideotrans
Python: 3.10.1 (v3.10.1:2cd268a3a9, Dec 6 2021, 14:28:59) [Clang 13.0.0 (clang-1300.0.29.3)]

2 Replies

这个错误是由于缺少 NumPy 库导致的。从错误信息可以看出,您使用的是 MacOS 系统,通过源码部署的 pyVideoTrans。

解决方案:

  1. 重新安装依赖包:
    打开终端,进入您的 pyVideoTrans 项目目录(/Users/nine/pyvideotrans),然后执行以下命令重新安装依赖:

    cd /Users/nine/pyvideotrans
    pip install -r requirements.txt
  2. 如果上述步骤无效,请手动安装 NumPy:
    在终端中执行:

    pip install numpy
  3. 重启软件:
    完成安装后,重新启动 pyVideoTrans。

如果问题仍然存在,请检查您的 Python 环境是否正常,或者尝试创建一个新的虚拟环境重新安装所有依赖。

pip install numpy==1.26

Post Your Reply
Open source and free maintenance is not easy. If this project is helpful to you, please consider making a small donation to help the project continue to maintain and update.

Donate: https://ko-fi.com/jianchang512

Trending Questions