python - 地理编码:模块没有属性“google”
问题描述
我知道有几个人已经问过类似的问题,但我是一个初学者,几天来一直试图解决这个问题,但还没有运气。
我想进行地理编码并执行 geocoder.google 命令以获取该位置的纬度和经度,但由于某种原因,我的 Jupyter Notebook 中似乎没有运行“google”属性。
包位置:Python36>Lib>site-packages>geocode,里面包含了init .py、google.py等.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 并完成了这项工作。
推荐阅读
- shell - 尝试 dotnet lambda 打包 buildspec.yml 中的所有 .csproj 文件
- angular - 将组件中的数据绑定到服务返回视图 - Angular
- c# - 在没有工厂的情况下有条件地推迟昂贵的调用
- amazon-web-services - 有没有办法一次恢复多个快照?
- css - 赛普拉斯:如何获取伪进度元素的属性,如 --webkit-progress-bar 或 --moz-progress-bar
- html - 在不透明图像上具有透明背景的图像
- chromium - 每次打开用户编辑对话框时,SuiteCRM 十进制符号都会重置为用户名 - 可能是 chrome 自动填充问题
- find - 如何使用 find 或 xargs 计算包含至少两行的文件?
- c# - C# Dispatcher Invoke 和正常代码执行顺序
- sql - 从 ER 图中使用 SQL (PostgreSQL 13.1) 创建表