简体   繁体   中英

jupyter notebook ipywidgets not showing (no error)

I recently set up a new Conda environment and brought up previously working codes However, I found out that Jupyter widget does not seem to work properly

I did below things

conda install -c conda-forge ipywidgets

jupyter nbextension enable --py widgetsnbextension --sys-prefix

Could anyone tell me what am I missing??

from ipywidgets import widgets, Layout, Textarea, IntSlider, RadioButtons
transcripted = widgets.Textarea("hello", layout=Layout(width='100%', display='inline-flex', flex_flow = 'row wrap'))
submit_button = widgets.Button(description="submit")

display(transcripted)
display(submit_button)

the result is as below

Textarea(value='hello', layout=Layout(display='inline-flex', flex_flow='row wrap', width='100%'))
Button(description='submit', style=ButtonStyle())

screenshot

First, Save your work and close the notebook. Just run following command on cmd with run as administrator.

conda install -c conda-forge ipywidgets

It will also enable the extension for you (No need of run jupyter nbextension enable --py widgetsnbextension --sys-prefix )

After installing restart the notebook. It will fix your issue.

Refer to this as well!

To answer my own qustion.

(I am not administrator) I asked administrator to stop the jupyter notebook server and start it again.

After that it worked.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM