1

我的电脑崩溃了,我需要下载我存储在 Google Cloud 上的所有内容。我不是计算机技术人员,我似乎找不到从 Google Cloud 下载整个存储桶的方法。

我已尝试按照 Google 帮助文档中的说明进行操作。我已经下载并安装了 Python,我下载了 gsutil 并按照说明将其放入我的 c:\ 驱动器中(我可以在那里看到它)。当我转到命令提示符并键入 cd \gsutil 时,下一个提示符会显示“c:\gsutil>”,但我不知道该怎么做。

当我输入“gsutil config”时,它显示“file 'c:\gsutil\gsutil.py”,第 2 行 SyntaxError:编码问题 utf8”。

当我输入“python gsutil”(说明会给出命令列表)时,它说“'python' 不被识别为内部或外部命令、可运行程序或批处理文件”,即使我完成了完整的安装过程对于 Python。

有人建议我下载并安装了一个名为 Cloudberry Explorer 的更用户友好的程序,但我可以设置的源列表不包括 Google Cloud。

任何人都可以帮忙吗?

4

2 回答 2

0

Your research is correct, I think that the most efficient way of doing this is with gsutil. Troubleshooting this will be tricky, you'll have to have patience...especially since this is a windows.

First you need to confirm your python. Do the following command.

which python

if correctly installed, it should tell you the version number.

Check gsutil.py; it may help to open a python session and see if you can import the necessary modules. A session will start by just typing python. The modules is the usually at the beginning of the script... something like import "module" or from "blahh" import "blahh"

Once installed, this will do the trick: Download files and folders from Google Storage bucket to a local folder

于 2014-09-01T16:03:24.397 回答
0

您需要知道的第一件事是 gsutil 工具仅适用于 windows 的 python 版本 2.7 或更低版本。获得正确的 python 版本后,如果您是 Windows 用户,请按照以下步骤操作:

  1. 打开推荐提示并使用以下命令切换到您的 gsutil 目录: -- cd\ -- cd gsutil

  2. 进入 gsutil 目录后,执行以下命令:python gsutil config -b

  3. 这将打开一个浏览器链接,请求您访问您的谷歌帐户。请确保您从您要访问云存储的帐户登录谷歌并授予访问权限

  4. 完成后,这将为您提供一个 KEY(授权码)。复制该密钥并将其粘贴回命令提示符中。点击回车,现在这将询问您一个 PROJECT-ID。

  5. 现在导航到您的云控制台并提供 PROJECT-ID。

  6. 如果成功,这将在 c:\users 中创建一个 .boto 文件。

  7. 现在您已准备好从云控制台访问您的私有存储桶。为此,用户使用以下命令: C:\python27>python c:\gsutil\gsutil cp -r gs://your_bucked_id/path_to_file path_to_save_files

于 2014-11-14T06:03:55.843 回答