使用python-google-places 一个严重的bug 错误提示:lat_lng must be a dict with the keys, 'lat' and 'lng'
来源:互联网 发布:西安云计算公司 编辑:程序博客网 时间:2024/05/01 02:29
github地址:https://github.com/slimkrazy/python-google-places
详细教程:http://blog.csdn.net/dongyouyuan/article/details/76618442
在应用上线的一段时间,我们发现报错信息为 lat_lng must be a dict with the keys, 'lat' and 'lng'。报错量不是一般的多,除了每天一部分成功之外,我们发现其余的全部用不了,全在报错,监控的报错已经有几十页了。问题比较严重。经过一天的排查,发现这个包存在一个BUG,具体的问题可以github问题看到:https://github.com/slimkrazy/python-google-places/issues/59 看到。
具体的特征表现为,每天2500条可以正常使用,后面的全部报错,解决方法在github问题可以 pip install --upgrade https://github.com/slimkrazy/python-google-places/zipball/master 解决。
当中:主要修改了__init__.py中的 函数 geocode_location,因为该函数是使用了默认的 https://maps.googleapis.com/maps/api/geocode/json?sensor=false&address=United+States 求请求,google在这中开放的api中,限制了每台主机每天只能访问2500次,解决方法就是把google的key加上来:
https://maps.googleapis.com/maps/api/geocode/json?sensor=false&address=United+States&key=1234_5678
这样就能解决问题。希望您能够有所收获
- 使用python-google-places 一个严重的bug 错误提示:lat_lng must be a dict with the keys, 'lat' and 'lng'
- 关于The function get must be used with a prefix when a default namespace is not specified的错误
- 提交时提示错误This Bundle is invalid.New apps and app updates submitted to the App Store must be built with
- render() must be called with a dict, not a Context. return HttpResponse(t.render(c))解决
- 根据经纬度(lat,lng)查找附近的地点(续)
- Python异常:Django1.11--context must be a dict rather than RequestContext.
- Python 对dict 的 keys() 排序
- Constructor call must be the first statement in a constructor错误的理解
- 错误提示:No enclosing instance of type A is accessible. Must qualify the allocation with an enclosing
- JSON keys must not be null nor the \'null\' string.
- Django 中遇到的问题(1)TypeError: context must be a dict rather than Context.
- eclipse 提示错误The method of type must override a superclass method 的解决办法
- TypeError: context must be a dict rather than Context.
- Python TypeError: must be string or buffer, not dict
- The function default must be used with a prefix when a default namespace is not specified
- The function getXX must be used with a prefix when a default namespace is not specified
- The function size must be used with a prefix when a default namespace is not specified
- The function startsWith must be used with a prefix when a default namespace
- 常用的代理服务器常用以下端口
- C++调用C函数
- WeChall刷题(一)
- html的简单弹窗
- POJ 2777 Count Color(线段树+懒惰标记)
- 使用python-google-places 一个严重的bug 错误提示:lat_lng must be a dict with the keys, 'lat' and 'lng'
- 进程间通信1
- POJ 2516 Minimum Cost(最小费用最大流)
- python 安装pip
- [HihoCoder-1185] 连通性·三 【tarjan+缩点】
- Swap Nodes in Pairs leetcode java
- unity debug.log()富文本输出
- Java学习笔记---css动画
- 矩阵乘法