如何使用conda/pip install在公司代理后面安装软件包? [英] How to use conda/pip install to install packages behind a corporate proxy?

查看:109
本文介绍了如何使用conda/pip install在公司代理后面安装软件包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在R中,我可以使用

install.packages("pkgName")

安装新软件包没有问题.但是当我尝试使用python并执行pip install package时,它会失败并显示错误

to install a new package no problems. But when I tried python and do pip install package it fails with error

重试(重试(总计= 4,连接=无,读取=无,重定向=无,状态=无))断开连接后'NewConnectionError(':无法建立新的连接:[Errno 11004] getaddrinfo失败',)':/simple/pyarrow/

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/

我认为这是因为pip不像R一样会自动检测代理(在Internet Explorer中设置).

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.

我在网上找到的大多数信息都不起作用,或者对于没有专业知识的人来说太复杂了.

Most of the info I find online either don't work or is just too complicated for someone without specialist knowledge to follow.

conda安装也失败.

对此有一个简单的解决方法吗?

Is there an easy fix to this?

推荐答案

尝试在Windows命令提示符或PowerShell上使用以下命令:

Try using the below command on windows command prompt or PowerShell:

pip install --proxy DOMAIN \ username:password @ proxyserver:port软件包名称

用特定于系统的值替换DOMAIN,用户名,密码,代理服务器和端口.这适用于由企业代理服务器后面的Active Directory验证的Windows 10安装.

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.

这篇关于如何使用conda/pip install在公司代理后面安装软件包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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