![](/img/trans.png)
[英]How to use Google Cloud Client Library for Python to configure the gcloud project
[英]Deploying Python script that use google-api-python-client library as Google Cloud Function
我创建了一个 Python 脚本,它使用google-api-python-client 库从我的 DFA 帐户中提取数据。
我想将此脚本部署到Google Cloud Scheduler ,以便我可以每天运行此脚本。 当我部署Cloud Function时,我收到一条错误消息:
“ModuleNotFoundError:没有名为“googleapiclient”的模块。
在将"googleapiclient"
添加到requirements.txt
并再次部署后,我收到一个新错误,提示找不到要添加的googleapiclient
库。
请问可以在谷歌云平台下安装googleapiclient
库吗?
是的,可以在GCP中安装和使用googleapiclient
库。 在 python 代码中导入Google API 客户端时使用googleapiclient
模块。
import googleapiclient
然后在你的requirements.txt中添加google-api-python-client
# Function dependencies, for example:
# package>=version
google-api-python-client
您可以查看github
中使用googleapiclient
模块和此requirements.txt的示例代码。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.