Azure / Azure-TDSP-Utilities

Utilities and scripts developed as part of Microsoft's Team Data Science Process for productive data science
Creative Commons Attribution 4.0 International
373 stars 275 forks source link

ValueError: Button(description=u'Export', style=ButtonStyle()) cannot be transformed to a widget #38

Closed safydy closed 6 years ago

safydy commented 6 years ago

Platform: MacOsX 10.12.2 (Sierra) Environment : Python 2.7.14 :: Anaconda, Inc. Error in IDEAR.ipynb in Cell : Explore the target variable and onwards


---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-17-4ec3cfdce941> in <module>()
     26     get_ipython().magic(u'reset_report')
     27     get_ipython().magic(u'add_interaction_code_to_report')
---> 28     i = interactive(TargetAnalytics.custom_barplot, df=fixed(df), filename=fixed(filename), col1=w1, Export=w_export)
     29     hbox = widgets.HBox(i.children)
     30     display(hbox)

/Users/user/anaconda2/lib/python2.7/site-packages/ipywidgets/widgets/interaction.pyc in __init__(self, _interactive__interact_f, _interactive__options, **kwargs)
    192             getcallargs(f, **{n:v for n,v,_ in new_kwargs})
    193         # Now build the widgets from the abbreviations.
--> 194         self.kwargs_widgets = self.widgets_from_abbreviations(new_kwargs)
    195 
    196         # This has to be done as an assignment, not using self.children.append,

/Users/user/anaconda2/lib/python2.7/site-packages/ipywidgets/widgets/interaction.pyc in widgets_from_abbreviations(self, seq)
    292             if not (isinstance(widget, ValueWidget) or isinstance(widget, fixed)):
    293                 if widget is None:
--> 294                     raise ValueError("{!r} cannot be transformed to a widget".format(abbrev))
    295                 else:
    296                     raise TypeError("{!r} is not a ValueWidget".format(widget))

ValueError: Button(description=u'Export', style=ButtonStyle()) cannot be transformed to a widget
MercyPrasanna commented 6 years ago

I also get the exact same issue when using in Python 3.5 environment

tylernwatson commented 6 years ago

Likewise. This has come up as an issue multiple times and I can't find a resolution in any of them.

elenaterenzi commented 6 years ago

so it looks like all you need to do is downgrade ipywidgets to 4: i did the following:

pip uninstall ipywidgets
pip install ipywidgets==4

and it worked I would highly recommend the team developing this tooling to provide a conda dependencies yml file to ensure environment is created with all the right dependencies

jreynolds01 commented 6 years ago

yes, this is an issue with the version of ipywidgets - hopefully the new conda file addresses for the time being.