python - 如何修复“googlemaps.exceptions.ApiError:REQUEST_DENIED”
问题描述
这是我第一次使用谷歌地图 API 来获取数据。我已经需要一个来自谷歌云平台的 API 密钥。但是,它仍然会弹出这个错误“Googlemaps.exceptions.ApiError: REQUEST_DENIED (This API project is not authorized to use this API.)”。请帮忙!
# -*- coding: UTF-8 -*-
import io
import sys
sys.stdout=io.TextIOWrapper(sys.stdout.buffer,encoding='utf8')
from googlemaps import Client
from pprint import pprint
API_KEY = 'MY_API_KEY'
gmaps = Client(key=API_KEY)
geocode_result = gmaps.geocode("臺北市")
pprint(geocode_result)
googlemaps.exceptions.ApiError: REQUEST_DENIED (This API project is not authorized to use this API.)
解决方案
推荐阅读
- kubernetes - 如何在 Helm for Kubernetes 中循环不同的模板?
- javascript - 共享不需要的输入值的 HTML 表单
- scala - Nil 如何在 Scala 中被识别为 List 类中的方法
- ssl - Ansible SSL 例程:SSL23_GET_SERVER_HELLO:sslv3 警报握手失败
- matrix - 如何通过tableau创建外汇货币对相关矩阵
- c++ - 如何设置时间延迟以触发 Qt 中即将发生的事件
- java - 将 null 分配给 Java 中不再需要的变量
- javascript - 尝试部署我的第一个谷歌云功能 - 找不到快递
- phpexcel - 如何仅使用phpspreadsheet在最后一页上应用页脚
- javascript - 使用 ES6 reduce 或 map 计算数组嵌套对象的总和和百分比