小编Don*_*e Z的帖子

如何忽略AttributeError:'NoneType'

location = geolocator.geocode(" ".join(address.values()))
if location.longitude is not None:
    node['pos'] = [location.longitude, location.latitude]
Run Code Online (Sandbox Code Playgroud)

不明白的方式我仍然得到这个错误:

  File "/home/easypc/Documents/Udacity_nano_degree/Data_Wrangling/audit_vilnius.py", line 167, in shape_element
    if location.longitude is not None:
AttributeError: 'NoneType' object has no attribute 'longitude'
Run Code Online (Sandbox Code Playgroud)

python attributeerror geopy nonetype

1
推荐指数
1
解决办法
6761
查看次数

标签 统计

attributeerror ×1

geopy ×1

nonetype ×1

python ×1