Closed lihka1 closed 6 years ago
+1 i didn't update ipywidgets, i've just clone this repo into new DSVM and got the same error:
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-12-861d7cb8f6e1> in <module>()
----> 1 i = interactive(TargetAnalytics.custom_barplot, df=fixed(df), filename=fixed(filename), col1=w1, Export=w_export)
C:\Anaconda\envs\py35\lib\site-packages\ipywidgets\widgets\interaction.py 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,
C:\Anaconda\envs\py35\lib\site-packages\ipywidgets\widgets\interaction.py 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='Export', style=ButtonStyle()) cannot be transformed to a widget
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-12-b4e23ca35cec> in <module>()
21 get_ipython().magic('reset_report')
22 get_ipython().magic('add_interaction_code_to_report i = interactive(TargetAnalytics.custom_barplot, df=fixed(df), filename=fixed(filename), col1=w1, Export=w_export)')
---> 23 hbox = widgets.HBox(i.children)
24 display(hbox)
25 hbox.on_displayed(TargetAnalytics.custom_barplot(df=df0, filename=filename, col1=w1.value, Export=w_export))
AttributeError: 'int' object has no attribute 'children'
when running this cell:
md_text = '## Target Variable'
filename = 'tmp/target_variables.csv'
export_filename = 'target_report2.ipynb'
if conf_dict['Target'] in conf_dict['CategoricalColumns']:
w1_value,w2_value,w3_value = '','',''
w1, w2, w3, w4 = None, None, None, None
silentremove(filename)
w1 = widgets.Dropdown(
options=[conf_dict['Target']],
value=conf_dict['Target'],
description='Target Variable:',
)
ReportMagic.var_files = filename
w_export = widgets.Button(description='Export', value='Export')
handle_export_partial = partial(handle_export, w1=w1, w2=w2, w3=w3, export_filename=export_filename, md_text=md_text)
w1.observe(handle_change,'value')
w_export.on_click(handle_export_partial)
%reset_report
%add_interaction_code_to_report i = interactive(TargetAnalytics.custom_barplot, df=fixed(df), \
filename=fixed(filename), col1=w1, Export=w_export)
hbox = widgets.HBox(i.children)
display(hbox)
hbox.on_displayed(TargetAnalytics.custom_barplot(df=df0, filename=filename, col1=w1.value, Export=w_export))
else:
w1_value, w2_value, w3_value = '', '', ''
w1, w2, w3, w4 = None, None, None, None
silentremove(filename)
w1 = widgets.Dropdown(
options=[conf_dict['Target']],
value=conf_dict['Target'],
description='Target Variable:',
)
w_export = widgets.Button(description='Export', value='Export')
handle_export_partial = partial(handle_export, w1=w1, w2=w2, w3=w3, export_filename=export_filename, md_text=md_text)
w1.observe(handle_change,'value')
w_export.on_click(handle_export_partial)
%reset_report
%add_interaction_code_to_report i = interactive(NumericAnalytics.custom_barplot, df=fixed(df), filename=fixed(filename),\
col1=w1, Export=w_export)
hbox = widgets.HBox(ii.children)
display(hbox)
hbox.on_displayed(NumericAnalytics.custom_barplot(df=df, filename=filename, col1=w1.value, Export=w_export))
i am having the same issue
I am too Any track? Thanks
as per my comment in the other open issue (https://github.com/Azure/Azure-TDSP-Utilities/issues/38):
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
I've just created a pull request to add a conda environment yml file to address this.
When I update the ipywidgets, I get the error ...issue #26(Error in IDEAR.ipynb ('int' object has no attribute 'children') #26)