您的位置:首页 > 编程语言 > Python开发

python pip设置代理

2016-10-25 16:43 936 查看
python 安装 urllib2 库时,

pip install  urllib2 报错如下,

  Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after connec

tion broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connectio

n failed: 407 Proxy Authentication Required ( Forefront TMG requires authorizati

on to fulfill the request. Access to the Web Proxy filter is denied.  )',))': /s

imple/webscraping/

  Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after connec

tion broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connectio

n failed: 407 Proxy Authentication Required ( Forefront TMG requires authorizati

on to fulfill the request. Access to the Web Proxy filter is denied.  )',))': /s

imple/webscraping/

  Could not find a version that satisfies the requirement webscraping (from vers

ions: )

No matching distribution found for webscraping

需设置代理,

set HTTP_PROXY=domain\username:password@proxy:port
set HTTPS_PROXY=domain\username:password@proxy:port
[/code]

执行如下命令即可,
set HTTP_PROXY=icccuat\user_name:password@proxy_ip:port

set HTTPS_PROXY=icccuat\user_name:password@[b]proxy_ip
:port

pip install  urllib2[/b]
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: