#5453 连接被拒绝,请确保本地服务已启动并正在运行:Traceback (most recent call last): File "urllib3\connection.py", line 198, in _new_conn File "ur

188.253* Posted at: 10 hours ago

连接被拒绝,请确保本地服务已启动并正在运行:
Traceback (most recent call last):
File "urllib3\connection.py", line 198, in _new_conn
File "urllib3\util\connection.py", line 85, in create_connection
File "urllib3\util\connection.py", line 73, in create_connection
ConnectionRefusedError: [WinError 10061] 由于目标计算机积极拒绝,无法连接。

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

Traceback (most recent call last):
File "urllib3\connectionpool.py", line 787, in urlopen
File "urllib3\connectionpool.py", line 493, in _make_request
File "urllib3\connection.py", line 494, in 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 "urllib3\connection.py", line 325, in connect
File "urllib3\connection.py", line 213, in _new_conn
urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。

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

Traceback (most recent call last):
File "requests\adapters.py", line 644, in send
File "urllib3\connectionpool.py", line 841, in urlopen
File "urllib3\util\retry.py", line 519, in increment
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='127.0.0.1', port=9880): Max retries exceeded with url: /tts (Caused by NewConnectionError(': Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "videotrans\util\ListenVoice.py", line 16, in run
File "videotrans\tts\__init__.py", line 184, in run
File "videotrans\tts\_base.py", line 134, in run
File "videotrans\tts\_base.py", line 215, in _item_task
File "videotrans\tts\_gptsovits.py", line 81, in _run
File "requests\api.py", line 115, in post
File "requests\api.py", line 59, in request
File "requests\sessions.py", line 589, in request
File "requests\sessions.py", line 703, in send
File "requests\adapters.py", line 677, in send
requests.exceptions.ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=9880): Max retries exceeded with url: /tts (Caused by NewConnectionError(': Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。'))

1 Replies

这是由于 GPT-SoVITS 本地 TTS 服务未启动或端口错误导致的连接拒绝(127.0.0.1:9880)。

请按以下步骤排查:

  1. 确认服务已启动:必须确保 GPT-SoVITS 的 api.pyapi_v2.py 已在后台运行。仅打开 WebUI(默认 7860 端口)是不够的。
  2. 检查 API 地址:在软件 菜单 → TTS 设置 → GPT-SoVITS 中,API 地址应填写为 http://127.0.0.1:9880(或启动后实际监听的地址和端口)。如果启动了 api_v2.py,还需勾选 api_v2? 选项,否则会返回 {"detail":"Not Found"}
  3. 重新启动服务:若服务未启动,请运行对应的 Python 文件(如 python api.pypython api_v2.py)后再试。

如果问题依旧,请提供 GPT-SoVITS 启动后的控制台输出。

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. Dondate: ko-fi.com/jianchang512

Related resource