下载并导入Google Cloud Python



我在他们的github页面:https://github.com/GoogleCloudPlatform/google-cloud-python

第一个命令是pip install --upgrade google-cloud

这给了我:

Collecting google-cloud
  Could not find a version that satisfies the requirement google-cloud (from versions: )
No matching distribution found for google-cloud

我下载了他们的SDK,安装了他们的谷歌云SDK,我做了gcloud init,但我似乎无法将他们的python库导入我的。启动python并输入:

from google.cloud import datastore

给了我一个错误,它不存在作为一个模块…这些都来自他们的github所以我不确定我做错了什么

问题是团队正试图从gcloud过渡到google-cloud,这仍然是不完整的。

所有你需要做的是使用pip安装gcloud,你应该没事。

专业提示:python -m pip install --upgrade gcloud使用此命令将安装到您的python版本。

首先,确保您已经在系统上安装了gcloud,然后运行如下命令:

First: gcloud components update in your terminal.

then: pip install google-cloud

对于导入错误:

我也遇到过类似的问题。在我的pip命令中添加"——ignore-installed"使它能够正常工作。

这可能是pip中的一个错误-详细信息请参阅本页:https://github.com/pypa/pip/issues/2751

最新更新