Python LocationValueError: No host specified

一曲冷凌霜 提交于 2019-12-06 07:57:37

error location:

Lib\urllib\request.py:
proxyEnable = winreg.QueryValueEx(internetSettings, 'ProxyEnable')[0]

if proxyEnable is string , you'll see the error. The reason is in your registry, ProxyEnable is set as REG_SZ but not REG_DWORD, so change it and all is ok. open the registry:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings \ ProxyEnable

(you can also directly search ProxyEnable)

delete ProxyEnable create a new ProxyEnable form (REG_SZ 0) to (REG_DWORD 0x00000000(0))

see follow pictures,my pc language is chinese, but the location for ProxyEnable is the same.

create a new ProxyEnable

right value for ProxyEnable

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!