简体   繁体   English

无法通过 pip 在 AWS EMR Notebook 上安装包

[英]Unable to install package through pip on AWS EMR Notebook

I'm using a Jupyter Notebook connected to an AWS EMR Cluster.我正在使用连接到 AWS EMR 集群的 Jupyter Notebook。 The subnets and security groups attached to all nodes of the cluster are able to connect to the internet.连接到集群所有节点的子网和安全组都能够连接到 Internet。 However, when I attempt to pip install <package> from the Notebook attached to the EMR cluster, I get the following error:但是,当我尝试从附加到 EMR 集群的笔记本中pip install <package> ,我收到以下错误:

WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f6b4c6bd710>: Failed to establish a new connection: [Errno 101] Network is unreachable')': .... . WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f6b4c6bd710>: Failed to establish a new connection: [Errno 101] Network is unreachable')': .... .

I have also tried to make a GET request to the internet r = requests.get('https://www.google.com') , which was also unsuccessful.我还尝试向互联网r = requests.get('https://www.google.com')发出 GET 请求,但也未成功。 I'm unable to figure out what is preventing my connectivity to the internet from my Jupyter Notebook on AWS EMR.我无法弄清楚是什么阻止了我从 AWS EMR 上的 Jupyter Notebook 连接到 Internet。

Since you are able to connect to internet with cluster, so it might be the problem with security groups of notebook itself not the cluster.由于您可以通过集群连接到互联网,因此可能是笔记本本身的安全组而不是集群的问题。

Are you using default security groups for EMR notebook like described here or are you assigning your own security group?您是使用此处所述的 EMR 笔记本的默认安全组还是分配您自己的安全组? if yes,make sure you have right outbound rules, try to add outbound rules and allow traffic如果是,请确保您有正确的出站规则,尝试添加outbound rules并允许流量

在我的情况下,结果证明是我创建的 sg ElasticMapReduceEditors-Livy 和 ElasticMapReduceEditors-Editor 的问题,我只是在两个 sg 中添加了一个规则,允许所有出站流量测试是否解决了它,幸运的是它解决了它,然后我删除了这两个规则,并且神秘地我的笔记本继续像往常一样工作,我认为这是 aws 的不良行为。

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

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