#7241 [deepseek] 无法连接到 https://api.deepseek.com/v1/,可能当前网络不可访问该API, 若是本地服务,请确认已部署并启动Connection error.:Traceback (most recent c

2405** Posted at: 1 hour ago

[deepseek] 无法连接到 https://api.deepseek.com/v1/,可能当前网络不可访问该API, 若是本地服务,请确认已部署并启动
Connection error.:Traceback (most recent call last):
File "httpx\_transports\default.py", line 101, in map_httpcore_exceptions
File "httpx\_transports\default.py", line 250, in handle_request
File "httpcore\_sync\connection_pool.py", line 216, in handle_request
File "httpcore\_sync\connection_pool.py", line 196, in handle_request
File "httpcore\_sync\connection.py", line 99, in handle_request
File "httpcore\_sync\connection.py", line 76, in handle_request
File "httpcore\_sync\connection.py", line 154, in _connect
File "httpcore\_backends\sync.py", line 152, in start_tls
File "contextlib.py", line 153, in exit
File "httpcore\_exceptions.py", line 14, in map_exceptions
httpcore.ConnectError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1017)

The above exception was the direct cause of the following except
......
ttpx\_client.py", line 1014, in _send_single_request
File "httpx\_transports\default.py", line 249, in handle_request
File "contextlib.py", line 153, in exit
File "httpx\_transports\default.py", line 118, in map_httpcore_exceptions
httpx.ConnectError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1017)

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

Traceback (most recent call last):
File "videotrans\translator\_openaicompat.py", line 88, in _item_task
File "videotrans\translator\_openaicompat.py", line 48, in _create_completion
File "openai\_utils\_utils.py", line 298, in wrapper
File "openai\resources\chat\completions\completions.py", line 1215, in create
File "openai\_base_client.py", line 1332, in post
File "openai\_base_client.py", line 1072, in request
openai.APIConnectionError: Connection error.

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

Traceback (most recent call last):
File "videotrans\util\TestSrtTrans.py", line 19, in run
File "videotrans\translator\_runner.py", line 67, in run
File "videotrans\translator\_base.py", line 70, in run
File "videotrans\translator\_base.py", line 153, in _run_srt
File "tenacity\__init__.py", line 338, in wrapped_f
File "tenacity\__init__.py", line 477, in call
File "tenacity\__init__.py", line 378, in iter
File "tenacity\__init__.py", line 400, in
File "concurrent\futures\_base.py", line 451, in result
File "concurrent\futures\_base.py", line 403, in __get_result
File "tenacity\__init__.py", line 480, in call
File "videotrans\translator\_openaicompat.py", line 90, in _item_task
videotrans.configure.excepts.StopTask: [deepseek] 无法连接到 https://api.deepseek.com/v1/,可能当前网络不可访问该API, 若是本地服务,请确认已部署并启动
Connection error.


=
system:Windows-10-10.0.26200-SP0
version:v4.12
frozen:True
language:zh_CN
root_dir:D:/Translate AI

1 Replies

#1 DeepSeek reply at 1 hour ago

核心原因是 SSL 证书校验失败(CERTIFICATE_VERIFY_FAILED: self signed certificate in certificate chain),说明网络链路中存在一个自签名证书的中间代理(例如公司防火墙、杀毒软件的HTTPS扫描、或正在运行的抓包/代理工具)拦截了到 api.deepseek.com 的请求,导致 Python 的 httpx 拒绝该连接。

解决方案(按顺序尝试):

  1. 关闭系统代理及代理软件
    如果开着 VPN、Clash、V2Ray 等代理工具,先完全关闭,重启软件后再测试。部分代理会注入自签名证书。
  2. 关闭杀毒软件/防火墙的HTTPS扫描功能
    360、火绒、卡巴斯基、ESET 等安全软件有"HTTPS 流量扫描/SSL 扫描"功能,会中间人替换证书。临时关闭该功能,或将软件目录加入白名单。
  3. 清空软件内的代理设置
    主界面 对齐控制 行右侧的"网络代理"文本框如果填写了代理地址,请清空后保存。填写无效代理同样会导致此报错。
  4. 检查系统环境变量中的代理
    打开 CMD 执行 set | findstr -i proxy,若存在 HTTP_PROXY / HTTPS_PROXY 等指向本地代理的变量,需要清除后重启软件。
  5. 若必须通过代理访问
    请将代理工具切换为"全局/TUN 模式",或使用不进行 SSL 中间人替换的透明代理,确保访问 api.deepseek.com 时不出现自签名证书。
  6. 排查网络环境
    若处于公司/学校内网,网关可能强制替换 SSL 证书。建议改用手机热点测试,确认是否为内网策略导致。
  7. 若以上仍无效,可先改用国内其他 AI 翻译渠道
    智谱AI阿里百炼字节火山 等渠道(这些域名默认不走代理),并在对应菜单填写密钥后使用。

请查阅相关文档:

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