解决python使用requests使用shadowsocks代理时报错: Missing dependencies for SOCKS support

python requests shadowsocks proxies: Missing dependencies for SOCKS support

Posted by alovn on January 26, 2020

在使用requests proxies时抛出这样一个错误:Missing dependencies for SOCKS support.

1
2
3
4
5
6
proxies = {
    "http": "socks5://127.0.0.1:1086",
    "https": "socks5://127.0.0.1:1086",
}
res = requests.get('http://2000019.ip138.com/', proxies = proxies)
print(res.text)

经查阅资料后发现为 Python 本身在没有安装 pysocks 时不支持 socks5 代理,需要安装一下:

1
pip3 install pysocks

参考