foyoux / pygtrans

谷歌翻译, 支持 APIKEY 一口气翻译十万条

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

配置完代理后为什么出现了ssl.py的文件错误?同样代理requests到google是通的。。。

jiangxuhao opened this issue · comments

status_code返回200后,在clint.detect调用时返回的错误:
raise ValueError("check_hostname requires server_hostname")

ValueError: check_hostname requires server_hostname
image

commented

刚刚测试,可行。你用的什么代理?

image

commented

你这个问题,其他网友出现过, 参考 #13

刚刚测试,可行。你用的什么代理?

image

V2rayN

commented

现在解决了吗? 虚拟环境也可能导致这样的错误。重建一个,不要使用 conda/miniconda

还没解决,确实是用的conda虚拟环境,我试试换个环境

commented

嗯嗯, 这个问题确实很奇怪, 然后你说用的 V2rayN, 那么罪魁祸首就是 Conda 了,有网友遇到过,上面忘说了。

刚想起了之前遇到的问题,似乎conda环境的requests.session上添加的proxy都会被系统代理覆盖,之前解决办法是在建立的session中添加一行session.trust_env = False,所以我做了同样的尝试,现在已经可以工作了。非常感谢!
image

commented

刚想起了之前遇到的问题,似乎conda环境的requests.session上添加的proxy都会被系统代理覆盖,之前解决办法是在建立的session中添加一行session.trust_env = False,所以我做了同样的尝试,现在已经可以工作了。非常感谢! image

@jiangxuhao Nice