-
Notifications
You must be signed in to change notification settings - Fork 168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"ValueError: lat_lng must be a dict with keys, 'lat' and 'lng'" when using location parameter #59
Comments
yes i got that too as of today. Yesterday everything was fine |
This doesn't sound good. I'll take a look at it later this evening. If somebody else could try to find out the source of the issue, that would
|
Actually it might be a caching problem
|
I got the same error when i first tried:
During handling of the above exception, another exception occurred: Traceback (most recent call last): i suspect if i have any API Key issue. i've switched on the Google Places Web Service API in my google account. is that enough? or this error is caused by other problems? thanks |
I got the same error today as well! |
Below is my full length of error report: * init.py --> init.pyrslt = gps.nearby_search(location = 'london, england', keyword = 'fish and chips', radius = 20000, types=[types.TYPE_FOOD]) Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): tried on python 2.7 anaconda, not yet find a problem. |
Just got the same message, in my case it was because I got disconnected from the internet, without diving into the code I assume that the response from the nearby method is not coming back complete or failing without a catch and moving on directly to try and get the places list. |
Bump, and suggested workaround: In init.py: Change
to be
Quickly tested with python 2.7.10 and 3.5.1 |
@Michels10 workaround makes it possible to use it with python 3.5, thanks ! |
@Michels10 still not working for me :/ |
I'm not sure if this is the exact cause of the bug, but it immediately stood out to me. Note the following code in some of the method definitions:
This (and similar) can cause all kinds of problems, because if |
Per issue slimkrazy#59 and slimkrazy#82, we should not be using mutable default arguments. This change properly handles arguments that need to default to mutable values.
Per issue slimkrazy#59 and slimkrazy#82, we should not be using mutable default arguments. This change properly handles arguments that need to default to mutable values.
Reporting the same issue occurring again as of March 27, 2017. Just works fine on a single call from the interpreter, but not from the script. The results obtained just recently with the exact same script now generate an error. |
Encountered same error tonight was working fine and then suddenly stopped with this error. Correction noted above is in int.py file. Very frustrating. |
Pull development version and same issue (2.7) |
The error is also occurring for me, sometimes not at all and sometimes 10 queries in a row. Please help! |
Do any of you have a stack trace of the error? Have any of you seen the error on the first API call, or is it always on subsequent calls? |
I'm having the same error. I'm using python and here's my code (loc is my location variable)
I have no idea why it's telling me the lat_lng is wrong, since I'm not even using it. |
It worked fine for a day and started seeing this error in my code. |
Hi, same issue here. Anyone have any luck resolving? |
Hi! This error happened today (7/16/2017) when I was running a code. It was working fine, but all of a sudden I got this error, and then no matter what I pass to the following, I get the error. I had started using this module, and was getting some results, but now I am stuck with the error. query_result = google_places.nearby_search( Kindly please help resolve this!! I will highly appreciate it. |
Ok folks - I will take a look at this, tonight. Truth be told, I've never been able to replicate, I might have better luck this evening. |
Hi there!
One of the things I checked is, location = geocoder.google(ZIP_CODE)
|
Fix in #100 |
@rmalshe Do you want to try the code in master before I go ahead and submit the fix to pypi? In terms of testing - I'd actually prefer to re-write this entire library with full tests. This library is very old and my motivation for creating it was to simply get a personal project prototype done quickly. I never imagined that others would actually use it. I wouldn't quite call this project an unwanted child, but finding time to get to issues can be quite tough. I'll try to help out as much as I can to ensure that folks like you can continue to use this library to get your work done. |
Let me try to run a long job now to see if this works out. I will keep you posted. Your idea is actually nice. Perhaps sometimes it is better to re-write the package rather than maintaining it on an ongoing basis. Your experience may have improved, and now that Google has changed a few things, it may be better to come up with a new package if it helps more and more people. |
I think the issue some people are having is that when you are over the query limit on the geocode api, it doesn't return an over quota error.
if any error occurs within geocode_location, such as being over the query limit, it will still return 'lat_lng must be a dict with the keys, 'lat' and 'lng''. Maybe there is a way to propagate any errors from geocode_location, so users can recognise when its an over quota error? |
Same issue occurred for me. |
I enabled everything and still get this error after a few requests on a new day (so it cannot be an over quota error). Was anybody able to fix it? |
I'm getting this error only when I try to visit the link to the next page of results, even though there's no issue with the initial call?: Traceback (most recent call last): |
My call to google places API passes in a keyword and a city, state (i.e. San Antonio, TX). It was working and all of the sudden started failing with
ValueError: lat_lng must be a dict with keys, 'lat' and 'lng'
. However, in the init.py file, this should only occur if it can't geocode the location. I've tried with different locations but now get the same error. Any idea what would have caused it? I haven't hit my API limits.The text was updated successfully, but these errors were encountered: