我创建了一个Python脚本,使用google-api-python-client库从我的DFA帐户中提取数据。
我想把这个脚本部署到Google Cloud Scheduler所以我可以每天运行这个脚本。当我部署云功能时,我收到一个错误说:
ModuleNotFoundError: No module named "googleapiclient".
在我将"googleapiclient"
添加到requirements.txt
并再次部署它之后,我得到了一个新的错误,说它找不到要添加的googleapiclient
库。
请问googleapiclient
库是否可以安装在Google云平台下?
可以在GCP中安装和使用googleapiclient
库. 模块使用googleapiclient
当导入Google API Client时在你的python代码中
import googleapiclient
然后在requirements.txt中添加google-api-python-client
# Function dependencies, for example:
# package>=version
google-api-python-client
您可以检查github
中使用googleapiclient
模块的示例代码和此requirements.txt。