0

I'm trying to use geocoder to get a desired output for altitude using latitudes and longitudes but it returns 'none' as output.

I've even tried testing geocoder with documentation codes to verify if outputs work but still receive 'none' as output.

As for Gmaps it simply doesn't want to display itself in jupyter notebook.

Note that I'm a python beginner and have tried to find what the issues are with no results.

import geocoder

g = geocoder.google('white house', method='places', key="API_KEY_HERE")
print(g.latlng)

g = geocoder.google([42.34539,-71.0696], method = 'elevation', key="API_KEY_HERE")
print (g.meters)
import gmaps

gmaps.configure(api_key='API_KEY_HERE')
fig = gmaps.figure()
fig

As stated before geocoder simply returns 'none' as input.

Gmaps simply returns the following output:

Figure(layout=FigureLayout(height='420px'))

1 Answers1

0

I get "None" output too when I use an invalid key. With a valid key, I get [38.8976763, -77.0365298] as response in your first Geocoder call, and likewise, the gmaps library works fine in my notebooks with my key.

This means that you are not using a key, or are using an invalid one. Please make sure you have billing enabled, the Maps APIs enabled (such as Geocoding API and JavaScript API), and use a valid API key.

Refer to Google's get started guide. For gmaps please see the authentication guide.

Hope this helps!

evan
  • 5,443
  • 2
  • 11
  • 20