pip、代理身份验证和“不支持代理方案”

2024-04-07

尝试在新的 python 安装上安装 pip。我遇到了代理错误。看起来像一个错误get-pip or urllib3??

问题是我是否必须经历设置的痛苦CNTLM 如此处所述 https://stackoverflow.com/questions/14149422/using-pip-behind-a-proxy或者有什么捷径吗?

get-pip.py 文档 http://pip.readthedocs.org/en/latest/installing.html说使用--proxy="[user:passwd@]proxy.server:port"指定代理和相关身份验证的选项。但似乎 pip 传递了整个事情,因为它是urllib3它将“myusr”解释为 url 方案,因为我猜有“:”(?)。

C:\ProgFiles\Python27>get-pip.py --proxy myusr:[email protected] /cdn-cgi/l/email-protection:80
Downloading/unpacking pip
Cleaning up...
Exception:
Traceback (most recent call last):
  File "c:\users\sg0219~1\appdata\local\temp\tmpxwg_en\pip.zip\pip\basecommand.py", line 122, in main
    status = self.run(options, args)
  File "c:\users\sg0219~1\appdata\local\temp\tmpxwg_en\pip.zip\pip\commands\install.py", line 278, in run
    requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
  File "c:\users\sg0219~1\appdata\local\temp\tmpxwg_en\pip.zip\pip\req.py", line 1177, in prepare_files
    url = finder.find_requirement(req_to_install, upgrade=self.upgrade)
  File "c:\users\sg0219~1\appdata\local\temp\tmpxwg_en\pip.zip\pip\index.py", line 194, in find_requirement
    page = self._get_page(main_index_url, req)
  File "c:\users\sg0219~1\appdata\local\temp\tmpxwg_en\pip.zip\pip\index.py", line 568, in _get_page
    session=self.session,
  File "c:\users\sg0219~1\appdata\local\temp\tmpxwg_en\pip.zip\pip\index.py", line 670, in get_page
    resp = session.get(url, headers={"Accept": "text/html"})
  File "c:\users\sg0219~1\appdata\local\temp\tmpxwg_en\pip.zip\pip\_vendor\requests\sessions.py", line 468, in get
    return self.request('GET', url, **kwargs)
  File "c:\users\sg0219~1\appdata\local\temp\tmpxwg_en\pip.zip\pip\download.py", line 237, in request
    return super(PipSession, self).request(method, url, *args, **kwargs)
  File "c:\users\sg0219~1\appdata\local\temp\tmpxwg_en\pip.zip\pip\_vendor\requests\sessions.py", line 456, in request
    resp = self.send(prep, **send_kwargs)
  File "c:\users\sg0219~1\appdata\local\temp\tmpxwg_en\pip.zip\pip\_vendor\requests\sessions.py", line 559, in send
    r = adapter.send(request, **kwargs)
  File "c:\users\sg0219~1\appdata\local\temp\tmpxwg_en\pip.zip\pip\_vendor\requests\adapters.py", line 305, in send
    conn = self.get_connection(request.url, proxies)
  File "c:\users\sg0219~1\appdata\local\temp\tmpxwg_en\pip.zip\pip\_vendor\requests\adapters.py", line 215, in get_connection
    block=self._pool_block)
  File "c:\users\sg0219~1\appdata\local\temp\tmpxwg_en\pip.zip\pip\_vendor\requests\packages\urllib3\poolmanager.py", line 258, in proxy_fro
m_url
    return ProxyManager(proxy_url=url, **kw)
  File "c:\users\sg0219~1\appdata\local\temp\tmpxwg_en\pip.zip\pip\_vendor\requests\packages\urllib3\poolmanager.py", line 214, in __init__
    'Not supported proxy scheme %s' % self.proxy.scheme
AssertionError: Not supported proxy scheme myusr

Storing debug log for failure in C:\Users\myusr\pip\pip.log

C:\ProgFiles\Python27>

当我在没有用户名和密码的情况下运行命令时,它工作正常,但代理拒绝请求,说它需要身份验证(“407authenticationrequired”)。

C:\ProgFiles\Python27>get-pip.py --proxy 111.222.333.444:80
Downloading/unpacking pip
  Cannot fetch index base URL https://pypi.python.org/simple/
  Could not find any downloads that satisfy the requirement pip
Cleaning up...
No distributions at all found for pip
Storing debug log for failure in C:\Users\sg0219898\pip\pip.log

C:\ProgFiles\Python27>cat C:\Users\sg0219898\pip\pip.log
------------------------------------------------------------
C:\ProgFiles\Python27\get-pip.py run on 09/29/14 16:23:26
Downloading/unpacking pip
  Getting page https://pypi.python.org/simple/pip/
  Could not fetch URL https://pypi.python.org/simple/pip/: connection error: ('Cannot connect to proxy.', error('Tunnel connection failed: 407 authenticationrequired',))
  Will skip URL https://pypi.python.org/simple/pip/ when looking for download links for pip
  Getting page https://pypi.python.org/simple/
  Could not fetch URL https://pypi.python.org/simple/: connection error: ('Cannot connect to proxy.', error('Tunnel connection failed: 407 authenticationrequired',))
  Will skip URL https://pypi.python.org/simple/ when looking for download links for pip
  Cannot fetch index base URL https://pypi.python.org/simple/
  URLs to search for versions for pip:
  * https://pypi.python.org/simple/pip/
  Getting page https://pypi.python.org/simple/pip/
  Could not fetch URL https://pypi.python.org/simple/pip/: connection error: ('Cannot connect to proxy.', error('Tunnel connection failed: 407 authenticationrequired',))
  Will skip URL https://pypi.python.org/simple/pip/ when looking for download links for pip
  Could not find any downloads that satisfy the requirement pip
Cleaning up...
  Removing temporary dir c:\users\sg0219~1\appdata\local\temp\pip_build_SG0219898...
No distributions at all found for pip
Exception information:
Traceback (most recent call last):
  File "c:\users\sg0219~1\appdata\local\temp\tmp36ynxd\pip.zip\pip\basecommand.py", line 122, in main
    status = self.run(options, args)
  File "c:\users\sg0219~1\appdata\local\temp\tmp36ynxd\pip.zip\pip\commands\install.py", line 278, in run
    requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
  File "c:\users\sg0219~1\appdata\local\temp\tmp36ynxd\pip.zip\pip\req.py", line 1177, in prepare_files
    url = finder.find_requirement(req_to_install, upgrade=self.upgrade)
  File "c:\users\sg0219~1\appdata\local\temp\tmp36ynxd\pip.zip\pip\index.py", line 277, in find_requirement
    raise DistributionNotFound('No distributions at all found for %s' % req)
DistributionNotFound: No distributions at all found for pip

C:\ProgFiles\Python27>

我简单地浏览了一下urllib3\poolmanager.py https://github.com/shazow/urllib3/blob/master/urllib3/poolmanager.py而且它似乎与用户名/密码没有任何关系。


这是对 URL 方案的抱怨(其中urlparse是理解是myusr),要解决这个问题,您应该这样做:

get-pip.py --proxy http://myusr:[email protected] /cdn-cgi/l/email-protection:80
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

pip、代理身份验证和“不支持代理方案” 的相关文章

随机推荐

  • 如何删除动态数组?

    我在这个问题的帮助下构建了一个数组 如何在 C 中使用 new 声明二维数组 https stackoverflow com questions 936687 how do i declare a 2d array in c using n
  • “tuple”对象不支持项目分配

    我正在使用 PIL 库 我正在尝试使图像看起来更红 这就是我所拥有的 from PIL import Image image Image open balloon jpg pixels list image getdata for pixe
  • 将字节数组转换为 CGImage

    我在无符号字符数组中有图像的灰度值 我想将其转换为CGImage这样我就可以使用它在 iOS 中显示它UIImage unsigned char 数组的每个值都是灰度图像的像素值 我正在使用以下代码 但图像未显示 void viewDidL
  • 与不使用 if 的测试相比,if 语句的效率如何? (C++)

    我需要一个程序来获取两个数字中较小的一个 我想知道是否使用标准 如果 x 小于 y int a b low if a lt b low a else low b 比这个更有效率或更低 int a b low low b a b a b gt
  • Excel:找出单元格是否包含/包含一系列单元格中的值

    我有一个职位列表 A 和短语列表 B 对于 A 中的每个标题 我想检查它是否包含 B 中的短语 任何短语 我不在乎是哪个 1 Example Column A Example Column B 2 Head of Marketing Sen
  • Kafka 无法在 Azure Web 应用服务上运行

    我们正在尝试在 Azure Web 应用服务上部署 Kafka 我们不断收到以下错误 容器 NN 未响应端口 2181 上的 HTTP ping 站点启动失败 请参阅容器日志进行调试 WEBSITES PORT 设置为 2181 并且在 D
  • 密码自加密可行吗?

    我一直在阅读有关密码存储的内容 基本上发现了两种常用的技术 使用单个密钥对存储的所有密码进行加密 Using hashes 使用带盐的哈希值 存储 自行加密 的密码是否存在缺陷 即加密一个txt 其中写着password1用密码passwo
  • AngularJS 如何发送多部分/混合

    我正在开发一个项目 我必须在 AngularJS 中上传少量 JSON 和文件 我已经使用 Danial Farid 的 Angular file upload 编写了代码 并且它正在工作 除了它总是发送 multipart form da
  • 运行 flutter doctor 时 Android 许可证状态未知

    我无法运行 flutter 应用程序 因为 Android 许可证未知的 cmd 部分中不断弹出错误 我什至尝试过更新 android studio 但没有帮助 还出现了一个错误 但我交叉检查了它要求删除的文件已经被删除 并且 androi
  • ASP.NET MVC - 使用相同的表单来创建和编辑

    创建用于创建新模型和编辑现有模型的表单的最佳实践方法是什么 人们可以为我指明方向吗 书呆子晚餐 http nerddinner codeplex com will really指明道路 创建 aspx
  • 如何从 webServiceTemplate 获取肥皂响应

    我需要使用 webServiceTemplate 获得肥皂响应 目前 在我现有的架构中 它使用函数 public boolean sendSourceAndReceiveToResult String uri Source requestP
  • 抗锯齿模式差异?

    这两种抗锯齿模式有区别吗 e Graphics SmoothingMode Drawing2D SmoothingMode AntiAlias e Graphics SmoothingMode Drawing2D SmoothingMode
  • Jekyll 中 localhost 和 github 页面的 Baseurl 行为不同

    我正在开发一个静态网站Jekyll 部署于github pages 我在使用配置文件中的 baseurl 时遇到问题 这是我的摘录 config yml baseurl blog url http remidoolaeghe github
  • Python:getopt、批处理文件和带空格的路径

    我正在使用 getopt 来解析选项和参数 我编写了一个批处理文件来调用 python 脚本 这样我就不必一遍又一遍地输入相同的命令 当我打印出参数列表时 路径被空格分割 并且每个路径都被单独解析 该路径用双引号引起来 但我不确定问题是什么
  • 无法配置 HTTPS 端点。未指定服务器证书,找不到默认的开发者证书

    我正在开发一个已配置 HTTPS 的结构应用程序 尽管我有有效的安装证书 但它抛出异常 这些说明来自这个博客 https www waynethompson com au blog dotnet dev certs https 为我工作 d
  • PHP:如何在字符串中的随机位置添加随机字符

    如何在字符串中的随机位置添加单个随机字符 0 9 或 a z 或 或 我可以通过以下方式获得随机位置 random position rand 0 5 现在我怎样才能得到一个随机数 0到9 OR随机字符 a 到 z OR OR 最后 我如何
  • 如何在 Xamarin for Android 中压缩文件?

    我有一个函数可以创建一个 zip 文件和传递的文件字符串数组 该函数确实成功创建了 zip 文件及其内部的 zip 条目文件 但这些 zip 条目文件是空的 我尝试了几种不同的方法 下面的函数代码是我最接近的工作代码 public stat
  • miniconda 和 miniforge 之间有什么区别?

    The 小型锻造厂 https github com conda forge miniforgeinstaller 是一个相对较新的 社区主导的 最小的 conda 安装程序 正如其自述文件中所述 可以直接与 Miniconda 进行比较
  • 如何在 Q/KDB 中生成格式化的日期字符串?

    如何从 Q 日期类型生成 ISO 日期字符串 yyyy MM dd 我考虑过连接各个部分 但我什至无法获取日期 月份 例如d 2015 12 01 d month prints 2015 12 即不仅仅是月份 如果您计划大规模执行此操作 即
  • pip、代理身份验证和“不支持代理方案”

    尝试在新的 python 安装上安装 pip 我遇到了代理错误 看起来像一个错误get pip or urllib3 问题是我是否必须经历设置的痛苦CNTLM 如此处所述 https stackoverflow com questions