我正在他们的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
。
你需要做的就是使用gcloud
安装pip
,你应该没问题。
专业提示:使用此命令的python -m pip install --upgrade gcloud
将为您的python版本安装它。
首先,确保在系统上安装了gcloud
,然后运行如下命令:
第一:你终端的gcloud components update
。
然后:pip install google-cloud
并为导入错误:
我遇到了类似的问题。在我的pip命令中添加“--ignore-installed”使它对我有用。
这可能是pip中的一个错误 - 有关更多详细信息,请参阅此页面:https://github.com/pypa/pip/issues/2751