lik*_*stc 7 python google-maps
我按照指示行事
pip install GoogleMaps
Run Code Online (Sandbox Code Playgroud)
安装谷歌地图.但是当我尝试导入GoogleMaps类时,虽然安装了googlemaps但它失败了.
Python 2.7.6 (default, Mar 22 2014, 22:59:38) [GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import googlemaps
>>>
>>> from googlemaps import GoogleMaps
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: cannot import name GoogleMaps
Run Code Online (Sandbox Code Playgroud)
有没有人知道为什么虽然安装了googlemaps但无法导入GoogleMaps?
也许文档有点过时:使用Client而不是GoogleMaps
>>> from googlemaps import Client
>>> dir(Client)
['__class__', '__delattr__', '__dict__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_generate_auth_url', '_get', 'directions', 'distance_matrix', 'elevation', 'elevation_along_path', 'geocode', 'reverse_geocode', 'timezone']
>>> help(Client)
Run Code Online (Sandbox Code Playgroud)
我认为 googlemaps 模块中没有定义名为 GoogleMaps 的类。
如果你尝试help(googlemaps)使用 python 解释器,那么你可以看到所有的类。
我希望这可以帮助你。
| 归档时间: |
|
| 查看次数: |
11047 次 |
| 最近记录: |