使用python-google-places 一个严重的bug 错误提示:lat_lng must be a dict with the keys, 'lat' and 'lng'
2017-08-14 20:48
1146 查看
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
这样就能解决问题。希望您能够有所收获
详细教程: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
这样就能解决问题。希望您能够有所收获
相关文章推荐
- 提交时提示错误This Bundle is invalid.New apps and app updates submitted to the App Store must be built with
- 提交时提示错误This Bundle is invalid.New apps and app updates submitted to the App Store must be built wit
- 提交时提示错误This Bundle is invalid.New apps and app updates submitted to the App Store must be built wit
- 提交时提示错误This Bundle is invalid.New apps and app updates submitted to the App Store must be built wit
- 提交时提示错误This Bundle is invalid.New apps and app updates submitted to the App Store must be built wit
- 使用 python3.6 调用 jieba 库出现的 ValueError: dictionary file dict.txt must be utf-8 错误
- 提交时提示错误This Bundle is invalid.New apps and app updates submitted to the App Store must be built wit
- Kettle解析JSON错误,We MUST have the same number of values for all paths,We can not find and data with path [$.
- .NET中使用GridView控件输入数据时出现“ Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index"的问题
- setTag使用错误The key must be an application-specific resource id.
- 错误提示:No enclosing instance of type A is accessible. Must qualify the allocation with an enclosing
- Apps and app updates submitted to the App Store must be built with Xcode 5.1.1 or later, and iOS 7 o
- 错误:is quoted with " which must be escaped when used within the value
- java错误提示------ The public type must be defined in its own file
- 举例android项目中的string.xml出现这个The character reference must end with the ';' delimiter.错误提示的原因及解决办法
- Android Build with Gradle and ProGuard : “The output jar must be specified after an input jar, or it
- 错误:is quoted with " which must be escaped when used within the value
- A class file was not written. The project may be inconsistent, if so try refreshing this project and building it. eclipse提示错误
- 问题: 在eclipse里使用ctr+shift+t打开一个类的时候,出现错误:Class file name must end with .class
- this bundle is invalid . new apps and app updates submitted to the app store must be built with publ