我目前正在学习 GCP,需要在 VM 实例中运行 python 笔记本。打开我的 VM 的 shell 时,我运行了以下代码:
sudo install python-pip
pip install --upgrade google-api-python-client
pip install --upgrade google-cloud-datastore
gcloud auth application-default login
然后我加载了我的 python 笔记本。运行此代码以启动笔记本时:
python mynotebook.py
我收到以下错误:
/home/rnby87/.local/lib/python2.7/site-packages/google/auth/_default.py:66: UserWarning: Your application has authenticated using end user credentials from Google Cloud SDK. We recommend that most server applications use service accounts instead. If your application continues to use end user credentials from Cloud SDK, you might receive a "quota exceeded" or "API not enabled" error. For more information about service accounts, see https://cloud.google.com/docs/authentication/warnings.warn(_CLOUD_SDK_CREDENTIALS_WARNING)
我正在运行来自 Google Cloud SDK 文档 ( https://cloud.google.com/datastore/docs/datastore-api-tutorial )的 python 代码
from google.cloud import datastore
def create_client(project_id):
return datastore.Client(project_id)
任何帮助深表感谢!谢谢!