我创建了一个 Python 脚本,它使用 google-api-python-client 库 ( https://github.com/googleapis/google-api-python-client ) 从我的 DFA 帐户中提取数据。
我想将此脚本部署到 Google Cloud Scheduler,以便我可以每天运行此脚本。当我部署该功能时,我收到一条错误消息“ModuleNotFoundError:没有名为“googleapiclient”的模块。
在将“googleapiclient”添加到 requirements.txt 并再次部署后,我收到一个新错误,提示找不到要添加的 googleapiclient 库。
请问可以在谷歌云平台下安装googleapiclient库吗?
是的,可以在GCPgoogleapiclient
中安装和使用该库。在 python 代码中导入Google API 客户端时使用模块。googleapiclient
import googleapiclient
然后google-api-python-client
在你的requirements.txt中添加
# Function dependencies, for example:
# package>=version
google-api-python-client
您可以从使用该模块和此requirements.txt的示例代码中查看此示例代码。github
googleapiclient
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句