如何在身份验证代理后面的 Windows 上使用 pip [英] How to use pip on windows behind an authenticating proxy

查看:28
本文介绍了如何在身份验证代理后面的 Windows 上使用 pip的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的计算机在 Windows 服务器上的代理后面运行 Windows(使用活动目录),我不知道如何使用 pip(在 python3 中)来完成它.我曾尝试使用 --proxy,但它仍然只是超时.我也试过设置一个很长的超时时间(60 秒),但这没什么区别.我的代理设置是正确的,我将它们与我在 TortoiseHG 中成功使用的那些进行了比较以确保.

My computer is running windows behind a proxy on a windows server (using active directory), and I can't figure out how to get through it with pip (in python3). I have tried using --proxy, but it still just timeouts. I have also tried setting a long timeout (60s), but that made no difference. My proxy settings are correct, and I compared them with those that I'm using successfully in TortoiseHG to make sure.

是否有任何其他人知道我可以尝试的技巧,或者 pip 是否有关于 Windows 代理的一些限制?

Are there any other tricks that anyone knows of that I can try, or is there some limitation in pip with regards to windows proxies?

更新:我失败的尝试涉及搜索 pypi.我刚刚尝试实际安装一些东西并且它起作用了.搜索仍然失败.这是否表示 pip 中存在错误,还是它们的工作方式不同?

Update: My failed attempts involved searching pypi. I've just tried actually installing something and it worked. Searching still fails though. Does this indicate a bug in pip or do they work differently?

推荐答案

我尝试了 2 个选项,它们都适用于我公司的 NTLM 身份验证代理.选项 1 是使用 --proxy http://user:pass@proxyAddress:proxyPort

I have tried 2 options which both work on my company's NTLM authenticated proxy. Option 1 is to use --proxy http://user:pass@proxyAddress:proxyPort

如果您仍然遇到问题,我建议您安装代理身份验证服务(我使用 CNTLM)并指向点它,即类似于 --proxy http://localhost:3128

If you are still having trouble I would suggest installing a proxy authentication service (I use CNTLM) and pointing pip at it ie something like --proxy http://localhost:3128

这篇关于如何在身份验证代理后面的 Windows 上使用 pip的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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