站都匹配不上. 用HTTPPasswordMgrWithDefaultRealm试试, 它会忽略realm, 只看url.
proxy_handler = urllib2.ProxyHandler({'http': 'http://openproxy.huawei.com:8080/'})
password_mgr = urllib2.HTTPPasswordMgrWithDefaultRealm()
proxy_auth_handler = urllib2.ProxyBasicAuthHandler(password_mgr)
proxy_auth_handler.add_password(None, 'http://openproxy.huawei.com:8080', 'xxx', 'xxx')
opener = urllib2.build_opener(proxy_handler, proxy_auth_handler)
urllib2.install_opener(opener)
看python解释器目录底下,有一个Scripts文件夹
将这个文件夹添加至环境变量或者在命令行cd到这个目录下,有俩种办法可以获取第三方包
pip install urllib2
easy_install urllib2
获取之后重启ide
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)