是否可以在集群创建并运行后在 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/