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

折月煮酒 提交于 2021-01-28 06:53:17

问题


In R I can use

install.packages("pkgName")

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

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/

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 install fails as well.

Is there an easy fix to this?


回答1:


Try using the below command on windows command prompt or 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.



来源:https://stackoverflow.com/questions/46720222/how-to-use-conda-pip-install-to-install-packages-behind-a-corporate-proxy

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!