#7191 无效的值或参数:'cp932' codec can't encode character '\u6807' in position 44: illegal multibyte sequenceconcurrent.futures.proce

125.67**3 Posted at: 1 hour ago

无效的值或参数:'cp932' codec can't encode character '\u6807' in position 44: illegal multibyte sequence
concurrent.futures.process._RemoteTraceback:
"""
Traceback (most recent call last):
File "urllib\request.py", line 1348, in do_open
File "http\client.py", line 1283, in request
File "http\client.py", line 1329, in _send_request
File "http\client.py", line 1278, in endheaders
File "http\client.py", line 1038, in _send_output
File "http\client.py", line 976, in send
File "http\client.py", line 1448, in connect
File "http\client.py", line 942, in connect
File "socket.py", line 857, in create_connection
File "socket.py", line 845, in create_connection
ConnectionRefusedError: [WinError 10061] 由于目标计算机积极拒绝,无法连接。

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "videotrans\process\stt_fun.py", line 63, in openai_whisper
File "whisper\__init__.py", line 137, in load_model
File "whisper\__init
......
do_open
urllib.error.URLError:

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "logging\__init__.py", line 1103, in emit
AttributeError: 'NoneType' object has no attribute 'write'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "concurrent\futures\process.py", line 246, in _process_worker
File "videotrans\process\stt_fun.py", line 138, in openai_whisper
File "logging\__init__.py", line 1512, in exception
File "logging\__init__.py", line 1506, in error
File "logging\__init__.py", line 1624, in _log
File "logging\__init__.py", line 1634, in handle
File "logging\__init__.py", line 1696, in callHandlers
File "logging\__init__.py", line 968, in handle
File "logging\__init__.py", line 1108, in emit
File "logging\__init__.py", line 1022, in handleError
File "traceback.py", line 121, in print_exception
UnicodeEncodeError: 'cp932' codec can't encode character '\u6807' in position 44: illegal multibyte sequence
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "videotrans\task\_only_one.py", line 44, in run
File "videotrans\task\trans_create.py", line 360, in recogn
File "videotrans\recognition\__init__.py", line 292, in run
File "videotrans\recognition\_base.py", line 143, in run
File "videotrans\recognition\_overall.py", line 31, in _exec
File "videotrans\recognition\_overall.py", line 73, in _openai
File "videotrans\configure\_base.py", line 285, in _new_process
File "concurrent\futures\_base.py", line 458, in result
File "concurrent\futures\_base.py", line 403, in __get_result
UnicodeEncodeError: 'cp932' codec can't encode character '\u6807' in position 44: illegal multibyte sequence


=
system:Windows-10-10.0.19045-SP0
version:v3.99
frozen:True
language:zh
root_dir:F:/FanYi/win-pyvideotrans-v3.99

1 Replies

#1 DeepSeek reply at 1 hour ago

核心原因有两点,按优先级说明:

  1. 模型无法下载(根本原因):日志中 ConnectionRefusedError: [WinError 10061] 由于目标计算机积极拒绝,无法连接,是 openai-whisper 在下载模型时无法连接网络。你使用的是 openai-whisper(内置) 渠道,首次使用需从国外网站下载模型,而该站已被屏蔽,必须科学上网或手动下载模型。
  2. 系统编码错误(表面报错)'cp932' codec can't encode character '\u6807' 是因为你的 Windows 系统区域/语言设置为日文(cp932 编码),当程序尝试输出包含中文"标"字的日志时编码失败。这只是模型下载失败后日志输出时引发的连锁错误,并非根本问题。

解决方案(按步骤)

第一步:解决模型下载问题

  • 你当前使用的是 openai-whisper(内置),此渠道的模型文件需从 OpenAI 服务器下载。有两个选择:

    • 方案A(推荐):改用 faster-whisper(内置) 渠道,其模型可从国内镜像站自动下载,成功率更高;
    • 方案B:手动下载 openai-whisper 所需的 .pt 模型文件,放到软件目录的 models/ 文件夹内。例如 large-v3 模型下载地址:
      https://openaipublic.azureedge.net/main/whisper/models/e5b1a55b89c1367dacf97e3e19bfd829a01529dbfdeefa8caeb59b3f1b81dadb/large-v3.pt
  • 若使用 faster-whisper,模型自动下载失败时,可参考手动下载放置方法。

第二步:解决编码报错(建议同时处理)

  • 该编码问题源于系统区域设置为日文(cp932)。可进入 Windows「控制面板 → 区域 → 管理 → 更改系统区域设置」,将非 Unicode 程序的语言改为「中文(简体,中国)」,并取消勾选"Beta:使用 Unicode UTF-8 提供全球语言支持"(或反之,视情况勾选尝试),重启电脑。
  • 注意:升级软件到 v4.12 可能也会改善部分日志输出兼容性问题,但根因仍是模型下载失败。

补充说明:请确认你的代理/VPN 是否正常运行。若开启了代理但端口不对,也会导致连接被拒(10061)。可在软件主界面右侧的网络代理文本框填写正确的代理地址,如 http://127.0.0.1:你的端口

请查阅相关文档:

Thinking...
Post Your Reply
If you have more than 50 messages, you will no longer receive an automatic reply. Please ask a new question!
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.

Dondate via ko-fi.com

Related resource