YaoFANGUK / video-subtitle-generator

视频音频生成字幕,生成srt文件。无需申请第三方API,本地实现音频转文本。基于Transformer的视频字幕生成框架。A GUI tool for generating subtitle from videos and generating srt files.
Apache License 2.0
854 stars 164 forks source link

安装依赖报错 #15

Closed dev-coco closed 1 year ago

dev-coco commented 1 year ago

运行 python gui.py 的时候出现下面的错误

ModuleNotFoundError: No module named 'utils.formatter'

已经尝试过 pip install utils 安装 utils 可是还是出现错误。

Python 版本 3.8.12

wongchichong commented 1 year ago

在video-subtitle-generator 里面

cd video-subtitle-generator 后 用powershell $env:PYTHONPATH += ";$pwd/backend"

或其他 弄好 PYTHONPATH

直接 用 python backend/main.py cli 的话就不用set PYTHONPATH

YaoFANGUK commented 1 year ago

修复了 再试下

dev-coco commented 1 year ago

运行 gui.py 成功,可以显示界面,但是运行的过程中出现缺少模块,后来我安装了 whisper、PySimpleGUI、config 之后就正常了,但是选择视频后点击「运行」出现下面的错误。

Exception in thread Thread-1:
Traceback (most recent call last):
  File "/Users/xxxxxx/opt/miniconda3/envs/vsgEnv/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/Users/xxxxxx/opt/miniconda3/envs/vsgEnv/lib/python3.8/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "gui.py", line 173, in task
    from backend import main
  File "/Users/xxxxxx/Downloads/video-subtitle-generator-main/backend/main.py", line 89, in <module>
    class SubtitleGenerator:
  File "/Users/xxxxxx/Downloads/video-subtitle-generator-main/backend/main.py", line 200, in SubtitleGenerator
    concurrency=config.DEFAULT_CONCURRENCY,
AttributeError: module 'config' has no attribute 'DEFAULT_CONCURRENCY'
YaoFANGUK commented 1 year ago

你直接pip install -r requirements.txt 不行吗

wongchichong commented 1 year ago

我补了这个 在 requirements.txt 下面...试试看

... ffmpeg-python==0.2.0 zhconv==1.4.3 PySimpleGUI==4.60.4 config==0.5.1 openai-whisper

YaoFANGUK commented 1 year ago

requirements.txt 原本就有这些吧, config是项目里面backend里面的,不是你pip install安装的,openai-whisper也用不到

dev-coco commented 1 year ago

我补了这个 在 requirements.txt 下面...试试看

... ffmpeg-python==0.2.0 zhconv==1.4.3 PySimpleGUI==4.60.4 config==0.5.1 openai-whisper

解决了

dev-coco commented 1 year ago

requirements.txt 原本就有这些吧, config是项目里面backend里面的,不是你pip install安装的,openai-whisper也用不到

requirements.txt 没有呢,按照这个安装完,再运行 python gui.py 依然会提示缺少模块