cesiumpy icon indicating copy to clipboard operation
cesiumpy copied to clipboard

Example from README gives Google warning and shows nothing

Open astrojuanlu opened this issue 5 years ago • 10 comments

I tried to run this on a recent version of Jupyter notebook:

import cesiumpy

v = cesiumpy.Viewer()

v.entities.add(cesiumpy.Box(dimensions=(40e4, 30e4, 50e4),
                            material=cesiumpy.color.RED, position=(-120, 40, 0)))
v

But I get this warning:

/home/juanlu/.pyenv/versions/3.7.4/envs/mbp37/lib/python3.7/site-packages/cesiumpy/extension/geocode.py:12: UserWarning: Since July 2018 Google requires each request to have an API key. Pass a valid `api_key` to GoogleV3 geocoder to hide this warning. See https://developers.google.com/maps/documentation/geocoding/usage-and-billing
  _GEOCODER = GoogleV3()

a JavaScript error message:

ReferenceError: Cesium is not defined

and a blank recangle:

Screenshot from 2019-10-11 11-49-25

astrojuanlu avatar Oct 11 '19 09:10 astrojuanlu

I guess this is related: https://github.com/sinhrks/cesiumpy/issues/75

astrojuanlu avatar Oct 11 '19 09:10 astrojuanlu

For some reason, rerunning the cell fixes the issue.

astrojuanlu avatar Oct 11 '19 11:10 astrojuanlu

Any suggestions on how to set the google api key? First Tutorial (01_simple_widget.ipynb) is not working for me also re-runnning no error but also no map.

rb83421 avatar Jan 31 '20 19:01 rb83421

I have same problem. Can you please tell us how to fix this issue?

smitp0829 avatar Feb 19 '20 04:02 smitp0829

👍 still an issue.

Joeffison avatar Feb 28 '20 13:02 Joeffison

I tried to run this on a recent version of Jupyter notebook:

import cesiumpy

v = cesiumpy.Viewer()

v.entities.add(cesiumpy.Box(dimensions=(40e4, 30e4, 50e4),
                            material=cesiumpy.color.RED, position=(-120, 40, 0)))
v

But I get this warning:

/home/juanlu/.pyenv/versions/3.7.4/envs/mbp37/lib/python3.7/site-packages/cesiumpy/extension/geocode.py:12: UserWarning: Since July 2018 Google requires each request to have an API key. Pass a valid `api_key` to GoogleV3 geocoder to hide this warning. See https://developers.google.com/maps/documentation/geocoding/usage-and-billing
  _GEOCODER = GoogleV3()

a JavaScript error message:

ReferenceError: Cesium is not defined

and a blank recangle:

Screenshot from 2019-10-11 11-49-25

Same situation for me. Rerunning does not help

AlexS12 avatar May 23 '20 17:05 AlexS12

I am running in Python 3.9 under WSL2 and getting the same error.

markuskreitzer avatar Oct 05 '21 19:10 markuskreitzer

This package has so much potential I'm really disappointed to hit this api key wall! Maybe I just can't find how /where to enter my key when I import cesiumpy in Jupyter Notebooks (python 3.9 also), but can't get past that import step without the same message. I had already imported all the other packages before this point and cesiumpy is triggering it. "ConfigurationError: Since July 2018 Google requires each request to have an API key. Pass a valid api_key to GoogleV3 geocoder to fix this error. See https://developers.google.com/maps/documentation/geocoding/usage-and-billing Screen Shot 2021-11-15 at 1 36 28 PM "

khurchla avatar Nov 15 '21 18:11 khurchla

One hackfix is downgrading the geopy version.

pip install geopy==2.0.0

erikreed avatar May 16 '22 19:05 erikreed

I tried the hack and it returns and error:


AttributeError Traceback (most recent call last) /tmp/ipykernel_3405/636219109.py in ----> 1 import cesiumpy

~/.conda/envs/cezium3.7/lib/python3.7/site-packages/cesiumpy/init.py in 4 # data 5 import cesiumpy.data.country # noqa ----> 6 countries = cesiumpy.data.country.CountryLoader() # noqa 7 8 # entities

AttributeError: module 'cesiumpy' has no attribute 'data'

johndehart avatar Oct 12 '23 12:10 johndehart