当前位置: 代码迷 >> python >> 地理编码:模块没有属性“ google”
  详细解决方案

地理编码:模块没有属性“ google”

热度:102   发布时间:2023-06-27 21:57:27.0

我知道有几个人已经问过类似的问题,但是我是一个初学者,试图解决这一问题已经好几天了,还没有运气。

我想地理编码器并执行geocoder.google命令以获取位置的纬度和经度,但是出于某些原因,“谷歌”属性似乎未在我的Jupyter Notebook中运行。

软件包位置:Python36> Lib> site-packages> geocode,其中包含.py文件列表,例如init .py和google.py。

import geocoder
from geocoder import google
g = geocoder.google('Mountain View, CA')

AttributeError                            Traceback (most recent call last)
<ipython-input-38-baacb41ba0bf> in <module>()
  1 import geocoder
  2 #from geocoder import google
  3 g = geocoder.google('Mountain View, CA')
  4 #g.latlng
  5 

AttributeError: module 'geocoder' has no attribute 'google'

谢谢,

我碰巧要卸载Anaconda并重新安装python并完成此操作。

  相关解决方案