Search code examples
pythonoverpass-apinominatim

Overpy returning attribute error upon import


I've been testing some code utilizing overpy before christmas and now it's giving me an attribute error. Is anyone else having this issue? Or is my console corrupted?

Code:

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)

Returns

AttributeError: module 'overpy' has no attribute 'Overpass

Documentation linked here

https://readthedocs.org/projects/python-overpy/downloads/pdf/stable/


Solution

  • Downloaded Python natively and ran with Pycharm and it worked, may be an issue with my anaconda.

    Thanks