Welcome to DOFBOT-Ultra repository
4. Jupyter widgets configuration tutorial
4. Jupyter widgets configuration tutorial
1. Install ipywidgets
- Refer to
1. Jupyter lab environment setup tutorialto install Jupyter lab. - Check whether
nodeandnmpare installed. If the version number is displayed, it means that they are installed. You can continue to operate (the second part Install Node.js can be skipped directly). Otherwise, you should jump to Second, Install Node.js first, install Node.js and then operate below. (As shown in the figure, both versions can be used directly)
node -v && npm -v

- Install @jupyter-widgets/jupyterlab-manager (this step needs to be done in jupyter lab)
First, enable the third-party extension community
Then install (install) @jupyter-widgets/jupyterlab-manager management plug-in
After the installation is complete, the plug-in will appear in the INSTALLED (installed) area, as shown below.
Generally, after the installation is complete, you will be prompted to re-Build JupyterLab. This process will be relatively long, and there will be no prompt after success. It is recommended to wait for about 2-3 minutes before re-entering jupyterlab. If there is no prompt Build JupyterLab, it means that the build is successful.

- Install
ipywidgets
xxxxxxxxxxpip3 install ipywidgets
- Enable
widgetsnbextension
xxxxxxxxxxjupyter nbextension enable --py widgetsnbextension
- Delete temporary and static directories
xxxxxxxxxxjupyter lab cleanjupyter lab path
- Restart
xxxxxxxxxxsudo reboot
2. Install Node.js
- Check the system architecture, as shown below.
xxxxxxxxxxuname -a

- Enter the Nood.js official website download page and find the corresponding version to download

- Unzip the downloaded compressed file (the current Nood.js official website provides version 12.19.0. If the subsequent version changes, please follow the actual situation)
xxxxxxxxxxxz -d node-v12.19.0-linux-armv7l.tar.xztar -xavf node-v12.19.0-linux-armv7l.tar
- Delete the existing
/usr/bin.nodein the system
xxxxxxxxxxsudo rm -rf /usr/bin/node
- Move the binary package to
/usr/local/node
xxxxxxxxxxsudo mv ./node-v12.19.0-linux-armv7l /usr/local/node
- Create a soft link for
nodeandnpm
xxxxxxxxxxsudo ln -s /usr/local/node/bin/node /usr/bin/nodesudo ln -s /usr/local/node/bin/npm /usr/bin/npm
3. Verification
- Open and enter jupyter lab
xxxxxxxxxxjupyter lab
- Enter Notebook

- Copy and paste the sample code
xxxxxxxxxxfrom __future__ import print_functionfrom ipywidgets import interact, interactive, fixed, interact_manualimport ipywidgets as widgetsdef f(x):return xinteract(f, x=10);
- Use the shortcut key to start running. If the result is as follows, the Jupyter Widgets configuration is complete
Enter+Shift
