#2010 TaskCfg(cache_folder='D:/VideoCreateFile/pyvideotrans/tmp/24432/b3d6979bf8', target_dir='C:/Users/Robin Soon/Downloads/_

118.101* Posted at: 9 hours ago 👁14

翻译字幕阶段出错:[OpenAI ChatGPT] 系统错误 (22):Invalid argument:
Traceback (most recent call last):
File "videotrans\task\job.py", line 184, in run
File "videotrans\task\trans_create.py", line 456, in trans
File "videotrans\translator\__init__.py", line 917, in run
File "", line 15, in init
File "videotrans\translator\_chatgpt.py", line 35, in post_init
File "videotrans\util\help_misc.py", line 177, in get_prompt
File "pathlib.py", line 1132, in read_text
File "pathlib.py", line 1117, in open
OSError: [Errno 22] Invalid argument: 'D:\VideoCreateFile\pyvideotrans\videotrans\prompts\text\chatgpt.txt'

TaskCfg(cache_folder='D:/VideoCreateFile/pyvideotrans/tmp/24432/b3d6979bf8', target_dir='C:/Users/Robin Soon/Downloads/_video_out/12月14日 (1)-mp4', remove_noise=False, is_separate=False, detect_language='zh-cn', subtitle_language=None, source_language='简体中文', target_language='马来西亚语', source_language_code='zh-cn', target_language_code='ms', source_sub='C:/Users/Robin Soon/Downloads/_video_out/12月14日 (1)-mp4/zh-cn.srt', target_sub='C:/Users/Robin Soon/Downloads/_video_out/12月14日 (1)-mp4/ms.srt', source_wav='D:/VideoCreateFile/pyvideotrans/tmp/24432/b3d6979bf8/zh-cn.wav', source_wav_output='C:/Users/Robin Soon/Downloads/_video_out/12月14日 (1)-mp4/zh-cn.m4a', target_wav='D:/VideoCreateFile/pyvideotrans/tmp/24432/b3d6979bf8/target.wav', target_wav_output='C:/Users/Robin Soon/Downloads/_video_out/12月14日 (1)-mp4/ms.m4a', subtitles='', novoice_mp4='D:/VideoCreateFile/pyvideotrans/tmp/24432/b3d6979bf8/novoice.mp4', noextname='12月14日 (1)', shibie_audio=None, targetdir_mp4='C:/Users/Robin Soon/Downloads/_video_out/12月14日 (1)-mp4/12月14日 (1).mp4', instrument=None, vocal=None, back_audio='', background_music=None, app_mode='tiqu', subtitle_type=0, volume='+0%', pitch='+0Hz', voice_rate='+0%', voice_role='No', copysrt_rawvideo=True, clear_cache=False, translate_type=3, tts_type=0, recogn_type=1, model_name='large-v3-turbo', split_type=0, voice_autorate=False, video_autorate=False, cuda=True, name='C:/Users/Robin Soon/Downloads/12月14日 (1).mp4', basename='12月14日 (1).mp4', ext='mp4', dirname='C:/Users/Robin Soon/Downloads', shound_del_name=None, uuid='b3d6979bf8', remove_silent_mid=False, align_sub_audio=True, enable_diariz=False, nums_diariz=0, rephrase=0, only_out_mp4=False)


=
system:Windows-10-10.0.26200-SP0
version:v3.89
frozen:True
language:zh
root_dir:D:/VideoCreateFile/pyvideotrans

1 Replies

错误的核心原因是软件无法读取 ChatGPT 翻译所需的提示词文件,因为文件路径中包含中文字符。根据核心知识库的“路径限制”原则,软件路径严禁包含中文。

解决方案:

  1. 立即停止当前任务
  2. 将整个 pyvideotrans 文件夹移动到纯英文路径下。例如:

    • D:\videotrans (推荐)
    • E:\pyvideotrans
    • 绝对避免D:\视频翻译C:\Users\张三\Desktop 等包含中文的路径。
  3. 移动后,重新启动软件,再次尝试翻译。

根本原因分析:
从错误日志 OSError: [Errno 22] Invalid argument: 'D:\\VideoCreateFile\\pyvideotrans\\videotrans\\prompts\\text\\chatgpt.txt' 可以看出,软件尝试读取 chatgpt.txt 这个提示词文件时失败。虽然此路径本身是英文,但您的软件根目录 D:/VideoCreateFile/pyvideotrans 位于一个包含中文的父路径 C:/Users/Robin Soon/Downloads/ 下(从 target_dir 参数可推断出),这可能导致 Python 在处理某些文件操作时出现问题。为确保稳定,必须将软件主目录置于全英文路径下。

请按上述步骤操作后重试。

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