【问题标题】:How to run a python script on Google Cloud Platform VM如何在 Google Cloud Platform VM 上运行 python 脚本
【发布时间】:2018-02-05 16:55:39
【问题描述】:

我有一个在我的计算机上本地运行良好的 python 脚本,我还在 Google Cloud Platform 的数据桶中存储了一个副本。

我还使用 Debian Stretch 设置了一个 VM。

如果这很重要,python 程序会使用多个库。

如何从这里开始在 VM 上运行脚本?

在尝试 VM 方式之前,我尝试使用 App Engine 运行脚本、requirement.txt 和 app.yaml 文件,这似乎可以工作,但该过程在云 shell 中超时,没有任何输出/结果.

我尝试阅读 Google Cloud Platform 文档、谷歌搜索、在 youtube 上查找视频等,但似乎找不到任何内容。

【问题讨论】:

标签: python google-cloud-platform


【解决方案1】:

Compute Engine 实例包括最新版本的 Python,但不包括 pip。目前文档表明您需要安装它:

wget https://bootstrap.pypa.io/get-pip.py
sudo python get-pip.py

完成后,如果仍有问题,请查看此线程:

Run python script on Google Cloud Compute Engine

它可以帮助您在运行脚本时查找和修复错误。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-11-14
    • 1970-01-01
    • 1970-01-01
    • 2020-04-08
    • 2018-05-07
    • 1970-01-01
    • 2020-07-06
    相关资源
    最近更新 更多