Open codelocksdev opened 5 years ago
Thanks for raising this. I just ran your example and it worked fine.
Your error looks like it's caused by the Python parser failing to parse the source code. Could this be a copy-paste error where you accidentally pasted an unprintable / unparseable character?
I'll try manually retyping. Thanks for the suggestion.
I have been able to reproduce this by running Python 3.7. I believe the issue is with the underlying ipywidgets embedding code. I will investigate this further.
Re-opening this for the time being.
The underlying ipywidgets issue is referenced here:
Thanks for continuing to look into this. Please let me know if you find a solution!
For anyone interested in this, I suggest tracking PR 2278 on ipywidgets.
Hi, Thank you for looking into this. I have the same problem and need a solution ASAP. Should I edit the source code as suggested here: https://github.com/jupyter-widgets/ipywidgets/pull/2278? Or downgrade my Python?
Thank you!
I'd recommend using a virtual environment with Python 3.6. I believe IPywidgets has several incompatibilities with Python 3.7 at the moment.
thank you! i will try that. P.S. Possibly not the best place for this comment, but any advice on how to use embed_minimal_html in conjunction with flask? I'm very new to web development.
I would recommend asking that directly in ipywidgets, where any answer is likely to be more useful and seen by more people.
In case someone still hits this issue, installing a fresh version of ipywidgets (>=7.5.0) solved the issue for me on python 3.7.
pip3 install ipywidgets --upgrade
I was hoping upgrading ipywidgets would help, but now there is a different error (ipywidgets-7.5.1):
File "D:\github\shared-taxi\untitled2.py", line 4, in <module>
fig = gmaps.figure()
File "D:\Anaconda3\lib\site-packages\gmaps\figure.py", line 213, in figure
layout=widgets.Layout(width='100%', height='100%')
File "D:\Anaconda3\lib\site-packages\traitlets\traitlets.py", line 958, in __new__
inst.setup_instance(*args, **kwargs)
File "D:\Anaconda3\lib\site-packages\traitlets\traitlets.py", line 986, in setup_instance
super(HasTraits, self).setup_instance(*args, **kwargs)
File "D:\Anaconda3\lib\site-packages\traitlets\traitlets.py", line 977, in setup_instance
value.instance_init(self)
File "D:\Anaconda3\lib\site-packages\traitlets\traitlets.py", line 1692, in instance_init
super(Instance, self).instance_init(obj)
File "D:\Anaconda3\lib\site-packages\traitlets\traitlets.py", line 520, in instance_init
if (self._dynamic_default_callable(obj) is None) \
File "D:\Anaconda3\lib\site-packages\traitlets\traitlets.py", line 504, in _dynamic_default_callable
for cls in mro[:mro.index(self.this_class) + 1]:
ValueError: <class 'ipywidgets.widgets.widget.Widget'> is not in list
I'm using just the basic sample code for a marker with popup info test, and the two lines which were given in documentation for exporting to html. I get this output:
this is the complete code: