pbugnion / gmaps

Google maps for Jupyter notebooks
https://jupyter-gmaps.readthedocs.io/en/stable/
Other
760 stars 146 forks source link

TraitError: The 'config' trait of a Map instance must be a Config, but a value of class 'dict' (i.e. {'api_key': ''}) was specified. #182

Closed curtischong closed 7 years ago

curtischong commented 7 years ago

Yep it's this issue again... I've tried updating my ipywidgets and gmaps.

pbugnion commented 7 years ago

Thanks for raising this.

Can you post the output of:

import ipywidgets
print(ipywidgets.__version__)

import gmaps
print(gmaps.__version__)

... in the notebook that's causing trouble? It helps isolate errors if I know the exact versions causing issues.

kookoowaa commented 7 years ago

@pbugnion

I have the same kind of trouble with ipywidgets 7.0.1 and gmaps 0.6.1

pbugnion commented 7 years ago

Thanks. I still can't reproduce this, with ipywidgets 7.0.1 and gmaps 0.6.1. Somewhat confusingly, Map doesn't have a config trait at all, not even by inheritance.

I was just running:

import gmaps

gmaps.configure(api_key='AI...')
gmaps.Map()

To isolate this further, what version of traitlets are you running, and what version of Python?

pbugnion commented 7 years ago

Actually, I have a hunch that a private method in Map might clash with a private method in traitlets, though I'm not sure why. The strange lack of reproducibility might be due to platform differences in the Python MRO?

I've tried to fix this in PR #184 , which you can install with:

pip install gmaps==0.6.2-alpha0
jupyter nbextension enable --py --sys-prefix gmaps

... then restart your Python kernel.

Can you try this and see if the problem is fixed?

arjunrao87 commented 7 years ago

I had the same problem. Your fix seems to have solved it. Thanks!

pbugnion commented 7 years ago

Thanks for the feedback -- it's really valuable since I can't reproduce the error myself.

pbugnion commented 7 years ago

Since nobody has reported this for a while, I assume this fixes it. I have merged PR #184 and will cut release 0.6.2 shortly.