美文网首页
Python googletrans 错误汇总

Python googletrans 错误汇总

作者: 小杰杰杰 | 来源:发表于2021-01-26 15:47 被阅读0次

1、httpcore._exceptions.ConnectError: [Errno 61] Connection refused
此问题需要在命令行设置代理
例:

export HTTP_PROXY=http://127.0.0.1:8080; #换成你自己的代理地址
export HTTPS_PROXY=http://127.0.0.1:8080; #换成你自己的代理地址
export ALL_PROXY=socks5://127.0.0.1:8081#换成你自己的代理地址

2、ValueError: Unknown scheme for proxy URL URL('socks5://127.0.0.1: 8081')
这是因为googletrans依赖的httpx 不支持 socks5代理
解决方案是把ALL_PROXY换为http代理:

export HTTP_PROXY=http://127.0.0.1:8080; #换成你自己的代理地址
export HTTPS_PROXY=http://127.0.0.1:8080; #换成你自己的代理地址
export ALL_PROXY=http://127.0.0.1:8080 #换成你自己的代理地址

3、httpcore._exceptions.ConnectTimeout: _ssl.c:1106: The handshake operation timed out
如果你配置代理了。这是代理出问题了,请检查你的代理

相关文章

网友评论

      本文标题:Python googletrans 错误汇总

      本文链接:https://www.haomeiwen.com/subject/peigzktx.html