#1362 ModuleNotFoundError: No module named 'tenacity'

106.180* Posted at: 1 day ago 👁9

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/trans_create.py", line 358, in recogn

raw_subtitles = run_recogn(

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

from ._overall import FasterAll

File "/Users/nine/pyvideotrans/videotrans/recognition/_overall.py", line 9, in

from videotrans.recognition._base import BaseRecogn

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

from tenacity import RetryError

ModuleNotFoundError: No module named 'tenacity'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/nine/pyvideotrans/videotrans/task/job.py", line 118, in run

from videotrans.configure._except import get_msg_from_except

File "/Users/nine/pyvideotrans/videotrans/configure/_except.py", line 13, in

from tenacity import RetryError as TenRetryError

ModuleNotFoundError: No module named 'tenacity'


=
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)]

1 Replies

该错误是由于缺少 tenacity 依赖库导致的。这是一个源码部署环境下的常见问题。

解决方法:

  1. 打开终端,进入 pyVideoTrans 源码目录:

    cd /Users/nine/pyvideotrans
  2. 安装缺失的依赖

    pip install -r requirements.txt

如果上述命令执行失败或您之前使用的是虚拟环境,请尝试:

  1. 重新激活虚拟环境并安装(如果您使用了虚拟环境):

    # 假设您的虚拟环境在项目目录下的 venv 文件夹
    source venv/bin/activate
    pip install -r requirements.txt
  2. 安装完成后,重新启动 pyVideoTrans 即可。

如果问题依旧存在,可能是依赖冲突。您可以尝试单独安装缺失的模块:

pip install tenacity
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