python网络连接报错:ValueError("Unable to determine SOCKS version from %s" % proxy_url) ValueError: Unable to determine SOCKS version from socks://192.168.1.100:1080/

 

 

python应用proxy网络连接报错:

    return super().send(request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/devil/anaconda3/envs/pytorch/lib/python3.11/site-packages/requests/adapters.py", line 454, in send
    conn = self.get_connection(request.url, proxies)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/devil/anaconda3/envs/pytorch/lib/python3.11/site-packages/requests/adapters.py", line 350, in get_connection
    proxy_manager = self.proxy_manager_for(proxy)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/devil/anaconda3/envs/pytorch/lib/python3.11/site-packages/requests/adapters.py", line 215, in proxy_manager_for
    manager = self.proxy_manager[proxy] = SOCKSProxyManager(
                                          ^^^^^^^^^^^^^^^^^^
  File "/home/devil/anaconda3/envs/pytorch/lib/python3.11/site-packages/urllib3/contrib/socks.py", line 198, in __init__
    raise ValueError("Unable to determine SOCKS version from %s" % proxy_url)

   ValueError: Unable to determine SOCKS version from socks://192.168.1.100:1080/

 

 

 

 

==============================

 

 

解决方法:

export all_proxy=socks5://192.168.1.100:1080/
export ALL_PROXY=socks5://192.168.1.100:1080/

 

 

 

 

==============================

 

posted on 2023-12-01 21:58  Angry_Panda  阅读(516)  评论(0编辑  收藏  举报

导航