ValueError: check_hostname requires server_hostname idea 無法使用proxy下載python包


症狀
1.查看本地代理
1.1 python命令
from urllib.request import getproxies getproxies()
1.2 結果
{'http': 'http://127.0.0.1:7890', 'https': 'https://127.0.0.1:7890', 'ftp': 'ftp://127.0.0.1:7890'}
結果是這樣的情況,修改如下:

對症下葯
win10:
通過環境變量設置

重啟
查看 :

getproxies()
{'https': 'http://127.0.0.1:7890', 'http': 'http://127.0.0.1:7890'}
參考:
https://zhuanlan.zhihu.com/p/350015032


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM