使用googlemaps API,places_nearby查找具有特定关键字的附近位置

时间:2018-08-13 22:21:18

标签: python google-maps

我正在使用googlemaps api来使“健身房”靠近某个位置:

导入googlemaps api并输入我的用户密钥后:

client = googlemaps.Client(key)

latlon = ' [atitude, longitude'

nearby = client.places_nearby(latlon, keyword="gym", radius = 100)

print (nearby)

我遇到以下错误:

Traceback (most recent call last):
  File "C:/Users/dd/PycharmProjects/untitled/venv/file.py", line 11, in <module>
    nearby = client.places_nearby(latlon, keyword="gym", radius = 100)
  File "C:\Users\dd\PycharmProjects\untitled\venv\lib\site-packages\googlemaps\client.py", line 365, in wrapper
    result = func(*args, **kwargs)
  File "C:\Users\dd\PycharmProjects\untitled\venv\lib\site-packages\googlemaps\places.py", line 249, in places_nearby
    rank_by=rank_by, type=type, page_token=page_token)
  File "C:\Users\dd\PycharmProjects\untitled\venv\lib\site-packages\googlemaps\places.py", line 342, in _places
    return client._request(url, params)
  File "C:\Users\dd\PycharmProjects\untitled\venv\lib\site-packages\googlemaps\client.py", line 270, in _request
    extract_body, requests_kwargs, post_json)
  File "C:\Users\dd\PycharmProjects\untitled\venv\lib\site-packages\googlemaps\client.py", line 270, in _request
    extract_body, requests_kwargs, post_json)
  File "C:\Users\dd\PycharmProjects\untitled\venv\lib\site-packages\googlemaps\client.py", line 270, in _request
    extract_body, requests_kwargs, post_json)
  [Previous line repeated 7 more times]
  File "C:\Users\dd\PycharmProjects\untitled\venv\lib\site-packages\googlemaps\client.py", line 210, in _request
    raise googlemaps.exceptions.Timeout()
googlemaps.exceptions.Timeout 

0 个答案:

没有答案