Access is Denied when trying to use GeoLocation
psychoSherlock opened this issue · 5 comments
psychoSherlock commented
import winsdk.windows.devices.geolocation as wdg
import asyncio
async def getCoords():
locator = wdg.Geolocator()
pos = await locator.get_geoposition_async()
return [pos.coordinate.latitude, pos.coordinate.longitude]
def getLoc():
return asyncio.run(getCoords())
getLoc()
PermissionError: [WinError -2147024891] Access is denied
dlech commented
I would check the Windows settings to make sure location services are enabled.
psychoSherlock commented
Damn you are fast man. 😂 Silly me. That was the error. I was trying everything.
psychoSherlock commented
Also, just another silly doubt. Why does my laptop sometimes show not so accurate location but sometime it does?
psychoSherlock commented
Just wanna make sure if its using the hardware or the IP address
dlech commented
I don't know much about how it works.
Maybe this is helpful: https://support.microsoft.com/en-us/windows/windows-location-service-and-privacy-3a8eee0a-5b0b-dc07-eede-2a5ca1c49088