简体   繁体   English

如何使用 conda/pip install 在公司代理后面安装软件包?

[英]How to use conda/pip install to install packages behind a corporate proxy?

In RI can use在 RI 中可以使用

install.packages("pkgName")

to install a new package no problems.安装新包没问题。 But when I tried python and do pip install package it fails with error但是当我尝试 python 并执行 pip install package 时,它​​失败并显示错误

Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 11004] getaddrinfo failed',)': /simple/pyarrow/重试(重试(总计 = 4,连接 = 无,读取 = 无,重定向 = 无,状态 = 无))连接被 'NewConnectionError(':无法建立新连接:[Errno 11004] getaddrinfo failed',) ':/简单/pyarrow/

I think it's because pip doesn't know how to automatically detect the proxy (that's gets set in Internet Explorer) like R can.我认为这是因为 pip 不知道如何像 R 一样自动检测代理(在 Internet Explorer 中设置)。

Most of the info I find online either don't work or is just too complicated for someone without specialist knowledge to follow.我在网上找到的大多数信息要么不起作用,要么对于没有专业知识的人来说太复杂了。

conda install fails as well. conda install失败。

Is there an easy fix to this?有没有简单的解决方法?

Try using the below command on windows command prompt or PowerShell:尝试在 Windows 命令提示符或 PowerShell 上使用以下命令:

pip install --proxy DOMAIN\\username:password@proxyserver:port packagename

Replace the DOMAIN, username, password, proxy server and port with values specific to your system.使用特定于您的系统的值替换域、用户名、密码、代理服务器和端口。 This works for a windows 10 installation authenticated by Active Directory that is behind a corporate proxy server.这适用于由位于公司代理服务器后面的 Active Directory 验证的 Windows 10 安装。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM