圣诞节前我一直在测试一些代码,现在它给了我一个属性错误。还有其他人有这个问题吗?还是我的主机坏了
代码:
from geopy.geocoders import Nominatim
import overpy
api = overpy.Overpass()
geolocator = Nominatim(user_agent="specify_your_app_name_here")
location = geolocator.geocode(input('Enter location:'))
cords = (location.latitude, location.longitude, location.latitude, location.longitude)
result = api.query("node"+f'{cords}'+";out;")
node = result.nodes[0]
print(node.id)
print(location.latitude)
print(location.longitude)
返回
AttributeError: module 'overpy' has no attribute 'Overpass
此处链接的文档
https://readthedocs.org/projects/python-overpy/downloads/pdf/stable/
本机下载了Python并与Pycharm一起运行,它成功了,这可能是我的anaconda的一个问题
谢谢
相关问题 更多 >
编程相关推荐