Python - Pip 安装 - 代理错误 - '无法连接到代理.',OSError' [英] Python - Pip Install - Proxy Error - 'Cannot connect to proxy.', OSError'

查看:73
本文介绍了Python - Pip 安装 - 代理错误 - '无法连接到代理.',OSError'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在企业 VM 中安装一些模块以创建一些 Python 脚本.我正在尝试使用带有代理的 PIP 来完成它.我正在使用这个命令行:

I want to install some modules in a Enterprise VM in order to create some Python Scripts. I'm trying to use PIP with Proxy to do it. I'm using this command lines:

C:\Users\user>SET HTTPS_PROXY=https://user:pass@199.00.11.11:8080

C:\Users\user>SET PROXY=http://user:pass@199.00.11.11:8080

C:\Users\user>pip install datetime

要访问我的虚拟机,我有以下凭据:

To have access to my virtual machine I've this credentials:

  • 用户:NAN/用户
  • 通过:通过
  • USER: NAN/user
  • PASS: pass

但我收到此错误:

Collecting datetime
  Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 407 Proxy Authentication Required ( Forefront TMG requires authorization to fulfill the request. Access to the Web Proxy filter is denied.  )',))': /simple/datetime/
  Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 407 Proxy Authentication Required ( Forefront TMG requires authorization to fulfill the request. Access to the Web Proxy filter is denied.  )',))': /simple/datetime/
  Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 407 Proxy Authentication Required ( Forefront TMG requires authorization to fulfill the request. Access to the Web Proxy filter is denied.  )',))': /simple/datetime/
  Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 407 Proxy Authentication Required ( Forefront TMG requires authorization to fulfill the request. Access to the Web Proxy filter is denied.  )',))': /simple/datetime/
  Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 407 Proxy Authentication Required ( Forefront TMG requires authorization to fulfill the request. Access to the Web Proxy filter is denied.  )',))': /simple/datetime/
  Could not find a version that satisfies the requirement datetime (from versions: )
No matching distribution found for datetime

我需要做什么才能获得 python 模块?

What I need to do in order to get the python module?

推荐答案

试试这个:

set HTTP_PROXY=http://199.00.11.11:8080
set HTTPS_PROXY=https://199.00.11.11:8080

这篇关于Python - Pip 安装 - 代理错误 - '无法连接到代理.',OSError'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆