Skip to content Skip to sidebar Skip to footer

Always Getting None Values When Using Python Geocoder

Im using Python's geocoder lib , and Im trying to find city names based on lat and lng. The problem is that I always get None values, any ideas why? import geocoder lat = 44.020747

Solution 1:

In order for you to use Google's geocoding API with gecoder, you need to have the Google API keys set in the environment variables. See here.

To get the Geocoding API keys, you must first activate the API in the Google Cloud Platform Console and obtain the proper authentication credentials. You can get API credentials here,

https://cloud.google.com/maps-platform/#get-started

After getting the API key, you need to add the following code in order to use it.

import os

os.environ["GOOGLE_API_KEY"] = "API_KEY"

Source


Post a Comment for "Always Getting None Values When Using Python Geocoder"