python - 如何在 Google Dataproc 集群中安装 python 包

标签 python google-cloud-platform google-compute-engine google-cloud-dataproc

是否可以在集群创建并运行后在 Google Dataproc 集群中安装 python 包?

我尝试在主命令行中使用“pip install xxxxxxx”,但它似乎不起作用。

Google 的 Dataproc 文档没有提到这种情况。

最佳答案

这在集群创建后一般是不可能的。我建议使用初始化操作来执行此操作。

如您所见,默认情况下 pip 也不可用。因此,您需要运行 easy_install pip,然后运行 ​​pip install 命令。

最后,如果您打算在任何自动化中使用此集群,和/或您想要密封性,我建议创建一个 wheel,您将其存储在 GCS 中并在 init 操作中下载。然后你会安装你的轮子。 Wheels 增加了比直接从 pip 安装许多包更快的好处。

2019 年更新

请参阅本教程,了解如何在 Dataproc 上配置 Python 环境: https://cloud.google.com/dataproc/docs/tutorials/python-configuration

关于python - 如何在 Google Dataproc 集群中安装 python 包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50279905/

相关文章:

Python 等效于 R 的因子数据类型

google-app-engine - Google Compute Engine 上来自 GoDaddy 的 SSL 证书

virtual-machine - 在 Windows Server 2016 VM 中录制声音 - Google Cloud Platform

kubernetes - 将 GCloud 中 GKE 中的运行状况检查从 HTTP 更改为 TCP 后重置

networking - 从快照创建的 Google Cloud 虚拟机实例不允许 ssh

Python/Sqlite 程序,写成浏览器应用程序还是桌面应用程序?

python - 如何一次迭代两个字典并使用两个字典的值和键获得结果

python - 在本地主机上使用结构

kubernetes - istio是否允许相交规则?应用它的策略是什么?

amazon-web-services - 在云端特定时间运行docker容器