我有python的python google maps。我有这个代码:from googlemaps import GoogleMapsplace1 = raw_input("your address: ")place = raw_input("Destination: ")gmaps = GoogleMaps(api_key)directions = gmaps.direction(place1, place)for step in directions['Directions']['Routes']['seconds'][0]['Steps']: print step['descriptionHtml']我得到这个错误 Traceback (most recent call last): File "C:\Python27\test.py", line 152, in <module> directions = gmaps.direction(place1, place)AttributeError: 'GoogleMaps' object has no attribute 'direction'我正在尝试向用户询问他们的地址和目的地,然后找到路线。
2 回答

冉冉说
TA贡献1877条经验 获得超1个赞
看起来方法实际上是GoogleMaps.directions(origin, destination, **kwargs)
,请注意方法名称上的“ s”。这是指向API文档的链接。
添加回答
举报
0/150
提交
取消