python - 谷歌 API。导入的库没有属性
问题描述
嗨,希望任何人都可以提供帮助 =) 我正在尝试使用 Google API,并且构建实例没有属性。甚至来自 Google 的示例项目也不起作用: https ://developers.google.com/calendar/quickstart/python
我试图重新安装库并使用以下命令强制重新安装:“pip install --force-reinstall google-api-python-client”。
来自另一个谷歌网站的代码也不起作用:
from googleapiclient.discovery import build
API_KEY='my_apiKey'
GPLUS = build('plus', 'v1', developerKey=API_KEY)
TMPL = '''
User: %s
Date: %s
Post: %s
'''
items = GPLUS.event() # AttributeError: 'Resource' object has no attribute 'event'
解决方案
经过更多测试后,我可以验证是否存在属性,因为代码正在运行,但是 VS Code 中的 pylint 没有找到属性,因此将它们标记为不存在。
我不知道为什么会这样。
推荐阅读
- python - 我从 agaricus.txt.train 加载什么?
- c - 有没有办法用 for 循环按降序浏览和排序 C 中的结构元素?
- php - 为什么 INSERT INTO 不能在几乎相同的代码中工作?
- arrays - 将阵列中的纹理采样到 Voronoi 单元中
- kotlin - 如何避免公共财产?
- python - 仅获取在 Python 中使用 imaplib 获得的电子邮件的文本/纯文本部分
- python - 我想计算循环,其中列表相等和不相等
- wordpress - 如何在wordpress中创建与任何页面无关的菜单标题?
- java - 无法访问主线程上的数据库,因为它可能会长时间锁定 UI
- javascript - Kotlin eval() 危险吗?