To install ipywidgets from git, you will need:
- yarn package manager ** version 1.2.1 or later **
- the latest Jupyter Notebook development release
- Everything in the ipywidgets repository is developed using Jupyter notebook’s master branch.
- If you want to have a copy of ipywidgets that works against a stable version of the notebook, checkout the appropriate tag.
- See the Compatibility table
- the latest JupyterLab release
Installing With Conda¶
conda create -c conda-forge -n ipywidgets yarn notebook conda activate ipywidgets ipython kernel install --name ipywidgets --display-name "ipywidgets" --sys-prefix pip install --pre jupyterlab git clone https://github.com/jupyter-widgets/ipywidgets.git cd ipywidgets ./dev-install.sh
Notice that we install the prerelease of JupyterLab currently, which is only available via
Rebuilding after making changes¶
To build and test changes, run the following commands in the ipywidgets repository root directory, empty your browser’s cache, and refresh the page.
yarn run clean yarn run build
If your changes are confined to one package (for example, just in the widgetsnbextension package), then it may be sufficient to just run
yarn run build in that specific directory.
Tips and troubleshooting¶
If you have any problems with the above install procedure, make sure that permissions on npm and pip related install directories are correct.
Sometimes, it helps to clear cached files too by running
git clean -dfxfrom the root of the cloned repository.
If troubleshooting an upgrade and its build, you may need to do the following process:
Deep clean of the cloned repository:
git clean -dfx .
Remove anything with
widgetsnbextensionin the name of files within the
Try reinstalling ipywidgets
Updating widget model specification¶
To update the widget model specification with changes, do something like this in the repo root:
python ./packages/schema/generate-spec.py -f json-pretty packages/schema/jupyterwidgetmodels.latest.json python ./packages/schema/generate-spec.py -f markdown packages/schema/jupyterwidgetmodels.latest.md
Releasing new versions¶
See dev_release.md for a details on how to release new versions of ipywidgets to PyPI and jupyter-widgets-controls on npm.