Code Monkey home page Code Monkey logo

tutorial's Introduction

The Jupyter Widget Ecosystem

Tutorial, SciPy 2022

Installation

NOTE: These installation instructions install ipywidgets version 7.7. We anticipate that ipywidgets 8 will be released before the tutorial. If it, and all of the packages that we use that are dependent on ipywidgets have releases before the tutorial we will also provide ipywidgets 8 installation instructions.

Either way, we will include some of the new features of ipywidgets 8 in the tutorial.

Installation instructions last updated 2022-07-09

Read this if you set up the tutorial environment before 2022-07-09

We have added two packages to the list of requirements on 2022-07-09. To add those packages to the environment you have already created, either conda install -c conda-forge mpl-interactions=0.22.0 orjson=3.7.7 or, if you use pip, pip install mpl-interactions==0.22.0 orjson==3.7.7. Do not panic if you cannot update your environment; these packages are used in only two or three cells.

We strongly recommend using the conda Python distribution. You can install either miniconda (much smaller, only essential packages) or the full anaconda distribution (very extensive, but very, very large).

Almost all of the examples will work in either the regular Jupyter notebook or in JupyterLab. The instructions below assume you will be using JupyterLab.

We will spend a few minutes at the beginning of the tutorial pointing out some of the features of JupyterLab from the perspective of people already familiar with Jupyter notebooks.

There are also download instructions below for installation using pip, which should work with any Python distribution.

Download this repository

You can do this with either git clone https://github.com/jupyter-widgets/tutorial.git at the command line or by downloading this repostiory as a Zip file.

conda installation instructions

The steps below will get you a working environment.

conda env create -f environment.yml

conda activate widgets-tutorial-2022

# Create a kernel for this environment
ipython kernel install --name widgets-tutorial --display-name widgets-tutorial --sys-prefix

Windows users

The installation instructions were tested on an up-to-date version of Windows 10 Professional. If you encounter any issues on Windows please open an issue or contact us through slack.

pip installation instructions

If you are not using the anaconda python distribution, please use the instructions below.

pip install -r requirements.txt

# Create a kernel for this environment
ipython kernel install --name widgets-tutorial --display-name widgets-tutorial --sys-prefix

Check your installation

To check your installation, please download the script install_check.py and run it:

python install_check.py

Using binder

Click the badge below to run the tutorial online:

Binder

Many of the materials work without modification on mybinder.org without needing to install anything on your computer. However, this is not the recommended way to do the tutorial.

Any ipywidgets or custom widgets library question?

Please join us on the Gitter channel: https://gitter.im/jupyter-widgets/Lobby

Running into trouble?

Please let us know! You can open an issue on this repository by clicking "Issues" under the repo name on GitHub, then the "New Issue" button in the upper right.

tutorial's People

Contributors

bsyouness avatar dependabot[bot] avatar dougrzz avatar ianhi avatar ibdafna avatar imankulov avatar ivanov avatar jasongrout avatar jtpio avatar kir0ul avatar kohr-h avatar maartenbreddels avatar mackydiarra avatar marimeireles avatar martinrenou avatar mbektas avatar mwcraig avatar oliverevans96 avatar pluradj avatar sylvaincorlay avatar willingc avatar xgarrido avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tutorial's Issues

merge install commands

Some of the installation instructions exist out of multiple install commands (e.g. 3 for conda), is there a reason for it or should we merge it into 1 conda create command?

Takeaways from SciPy 2021

  • Shorter Styling section
  • Add a blurb on Python decorators and how they work, together with a link to further information
  • Shorten the interact section

Getting np array is not serializable error in several cells of ipycanvas

I'm getting

TypeError: Object of type int64 is not JSON serializable

In line

plot = ScatterPlot(x, y, sizes, colors, branca.colormap.linear.viridis, stroke_color='white')

From the ipycanvas example.

I've tried converting all the np arrays to a python type using:

import numpy as np

colors = np.random.rand(n_points) * 10 - 2
colors = colors.astype(np.float32)

But getting the exact same error. Really no clue what's going on here.

Doesn't seem like it's a regression from branca the plotting tool, as I've tested with earlier versions.
Is this a known issue with a new ipywidgets version?

Extensions build error

While running this command:

jupyter labextension install @jupyter-widgets/jupyterlab-manager @jupyter-widgets/jupyterlab-sidecar bqplot jupyter-threejs [email protected] ipysheet ipytree ipycanvas jupyter-matplotlib jupyter-vuetify ipyvolume Check your installation

I get the error:

Building jupyterlab assets (build:prod:minimize) An error occured. RuntimeError: npm dependencies failed to install See the log file for details: /tmp/jupyterlab-debug-anyv5l79.log

The log file has errors of this sort:

> [email protected] build:labextension /home/mih/miniconda3/envs/widgets-tutorial/share/jupyter/lab/staging/node_modules/jupyter-matplotlib
> jupyter labextension build .

Please supply at least one subcommand: check, disable, enable, install, link, list, uninstall, unlink, update
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build:labextension: `jupyter labextension build .`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build:labextension script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/mih/.npm/_logs/2021-01-15T18_14_53_268Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `webpack && npm run build:labextension`
npm ERR! Exit status 1
npm ERR!

So far I've tried reinstalling node and jupyter within the environment.

Fix errors in `07.01-ipycanvas` -- no attribute 'size'

The custom scatter plot and the game of life example fail because the canvas has no attribute size.

E.g. for the game of life example:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Input In [8], in <cell line: 50>()
     48 canvas.fill_style = '#FFF0C9'
     49 canvas.stroke_style = 'white'
---> 50 canvas.fill_rect(0, 0, canvas.size[0], canvas.size[1])
     52 draw(x, canvas, '#5770B3')
     54 display(canvas)

AttributeError: 'RoughCanvas' object has no attribute 'size'

ipygany is wonky

I'm not sure exactly why because I have no error messages, but the rendering of objs that use the TetraMesh look pretty bad:

Screenshot 2022-07-03 at 18 42 31

Do you have any idea for what's a good substitute?
Was thinking about going through 07-05 instead of using ipygany if you don't have any strong thoughts on it.

I know we always try to have a 3d rendering widget, correct? But not sure what to show.

I appreciate inputs!

Pandas DF and horirzontal scrollable output using the Output widget

I am having what I would consider a very minor issue but can't seem to wrestle it to the ground in the way I'd like to. Simply, I'd like to be able to display a horizontal scroll bar as part of an output widget when displaying large number of columns in a pandas data frame (53 columns). I can get the bar to appear if I use pixel units but not with what I would expect in 100% units. My code looks like:

layout = wd.Layout(overflow = 'scroll', width='100%', min_height='', max_height='640px')
out = wd.Output(layout=layout)
items = [out]
display(out)
with out:
display(df.describe())

My expectation would be that the dataframe would fill the width of the output cell, which it does, but the horizontal scroll bar doesn't show. If I crank this value down to 50% I get a scroll bar, but this isn't working as I would expect. If I open the output in a new view then I get what I would expect.

I've tied several variations including putting this int a VBox, with still no success, and I imagine I am missing something fairly simple. Any help would be much appreciated. Thanks,

Change install instructions back to using anaconda?

numpy doesn't exist on conda-forge for windows. We currently ask people to install it from conda-forge, which means things are broken for people with windows.

Either (a) use the anaconda numpy, or (b) don't install numpy, scipy, etc. with the basic installation instructions, and then install those with the extra widget examples if needed (and maybe install from anaconda?)

Flesh out exercises in 05.00

I think these need:

  • Less reliance on interact[ive].
  • More structure in remaining exercises
  • Maybe add screenshots of what result should look like

ipywidgets version

@mwcraig I tried the 04.00.widget-list.ipynb Notebook and it fails with:

---------------------------------------------------------------------------
TraitError                                Traceback (most recent call last)
<ipython-input-2-7734aac79b8d> in <module>
      2 help_url_base = ''
      3 # help_url_base='reference_guides/complete-ipywidgets-widget-list.ipynb'
----> 4 list_overview_widget(groups, columns=2, min_width_single_widget=200, help_url_base=help_url_base)

~/github/martinRenou/tutorial/notebooks/widget_org.py in list_overview_widget(groups, help_url_base, columns, min_width_single_widget)
    169                                 grid_gap='10px 10px')
    170         kid = widgets.GridBox(layout=layout)
--> 171         kid.children = [box_maker(k, v, group) for k, v in group_widgets.items()]
    172         kids.append(kid)
    173 

~/github/martinRenou/tutorial/notebooks/widget_org.py in <listcomp>(.0)
    169                                 grid_gap='10px 10px')
    170         kid = widgets.GridBox(layout=layout)
--> 171         kid.children = [box_maker(k, v, group) for k, v in group_widgets.items()]
    172         kids.append(kid)
    173 

~/github/martinRenou/tutorial/notebooks/widget_org.py in box_maker(name, widget, group)
    140             extra_args = {}
    141 
--> 142         wid = widget(description='A label!', **extra_args)
    143 
    144         try:

~/miniconda3/envs/tutorial/lib/python3.7/site-packages/ipywidgets/widgets/widget_templates.py in __init__(self, n_rows, n_columns, **kwargs)
    280     def __init__(self, n_rows=None, n_columns=None, **kwargs):
    281         super(GridspecLayout, self).__init__(**kwargs)
--> 282         self.n_rows = n_rows
    283         self.n_columns = n_columns
    284         self._grid_template_areas = [['.'] * self.n_columns for i in range(self.n_rows)]

~/miniconda3/envs/tutorial/lib/python3.7/site-packages/traitlets/traitlets.py in __set__(self, obj, value)
    583             raise TraitError('The "%s" trait is read-only.' % self.name)
    584         else:
--> 585             self.set(obj, value)
    586 
    587     def _validate(self, obj, value):

~/miniconda3/envs/tutorial/lib/python3.7/site-packages/traitlets/traitlets.py in set(self, obj, value)
    557 
    558     def set(self, obj, value):
--> 559         new_value = self._validate(obj, value)
    560         try:
    561             old_value = obj._trait_values[self.name]

~/miniconda3/envs/tutorial/lib/python3.7/site-packages/traitlets/traitlets.py in _validate(self, obj, value)
    589             return value
    590         if hasattr(self, 'validate'):
--> 591             value = self.validate(obj, value)
    592         if obj._cross_validation_lock is False:
    593             value = self._cross_validate(obj, value)

~/miniconda3/envs/tutorial/lib/python3.7/site-packages/traitlets/traitlets.py in validate(self, obj, value)
   1868     def validate(self, obj, value):
   1869         if not isinstance(value, int):
-> 1870             self.error(obj, value)
   1871         return _validate_bounds(self, obj, value)
   1872 

~/miniconda3/envs/tutorial/lib/python3.7/site-packages/traitlets/traitlets.py in error(self, obj, value)
    623             e = "The '%s' trait must be %s, but a value of %r was specified." \
    624                 % (self.name, self.info(), repr_type(value))
--> 625         raise TraitError(e)
    626 
    627     def get_metadata(self, key, default=None):

TraitError: The 'n_rows' trait of a GridspecLayout instance must be an int, but a value of None <class 'NoneType'> was specified.

I suppose it's because I have ipywidgets 7.5, I guess we need to update it, and update the installation instructions so that we use 7.5?

Failure in threejs notebook

When I run that notebook, I get this error:

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-2-46a9b6c588e8> in <module>()
     12                          height_segments=ny - 1)
     13 
---> 14 surf = Mesh(geometry=surf_g, material=LambertMaterial(map=height_texture(z[::-1], 'YlGnBu_r')))
     15 surfgrid = SurfaceGrid(geometry=surf_g, material=LineBasicMaterial(color='black'))
     16 hover_point = Mesh(geometry=SphereGeometry(radius=0.05), material=LambertMaterial(color='hotpink'))

NameError: name 'LambertMaterial' is not defined

Failure in ipyleaflet notebook

I hit this fairly early on:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-5-6d396365a627> in <module>()
----> 1 m.remove_layer(m.default_tiles)

AttributeError: 'Map' object has no attribute 'default_tiles'

A bit of voila time goes to juplite

Sorry, I thought about this too late.

I propose we talk a bit about the state of jupyter-lite, instead of 15 minutes of Voila?
What do you think?

Start 3:25 Widgets outside the context of the notebook
Voila (15 min)

Astro notebook issues

The current astro notebook has a number of problems and an omission:

  • pyWWT annotation (adding constellation lines, et, is not working)
  • pyWWT tour is not working.
  • ipyaladdin should be dropped.
  • astrowidgets would be added to illustrate image display.

Review `complete-ipywidgets-widget-list`

This is in the folder reference_guides and is linked to from 04.00-widget-list.

  • The instructions in 04.00 are really confusing (the fact that I wrote them makes it even more ๐Ÿ˜ฌ).
  • Need to add a widdgets import to each cell in complete-ipywidgets-widget-list, maybe? Otherwise running the cell fails because widgets hasn't been imported. Fixed in e29ea1fc583382971bcdbf26fbad503ee77d6be7
  • List is up to date with current ipywidgets widgest.

Problem while trying to build an environment using the `environment.yml` file

On my ubuntu 20 when I conda env create -f environment.yml && conda activate widgets-tutorial-2021 and try to run jupyter lab I get the following:

/home/mariana/miniconda3/envs/tutorial/lib/python3.8/site-packages/jupyter_server/transutils.py:13: FutureWarning: The alias `_()` will be deprecated. Use `_i18n()` instead.
  warnings.warn(warn_msg, FutureWarning)
[I 2021-06-21 13:39:53.511 ServerApp] jupyterlab | extension was successfully linked.
[W 2021-06-21 13:39:53.636 ServerApp] 'ExtensionManager' object has no attribute '_extensions'
Traceback (most recent call last):
  File "/home/mariana/miniconda3/envs/tutorial/bin/jupyter-lab", line 10, in <module>
    sys.exit(main())
  File "/home/mariana/miniconda3/envs/tutorial/lib/python3.8/site-packages/jupyter_server/extension/application.py", line 518, in launch_instance
    serverapp = cls.initialize_server(argv=args)
  File "/home/mariana/miniconda3/envs/tutorial/lib/python3.8/site-packages/jupyter_server/extension/application.py", line 488, in initialize_server
    serverapp.initialize(
  File "/home/mariana/.local/lib/python3.8/site-packages/traitlets/config/application.py", line 87, in inner
    return method(app, *args, **kwargs)
  File "/home/mariana/miniconda3/envs/tutorial/lib/python3.8/site-packages/jupyter_server/serverapp.py", line 1872, in initialize
    self.init_server_extensions()
  File "/home/mariana/miniconda3/envs/tutorial/lib/python3.8/site-packages/jupyter_server/serverapp.py", line 1698, in init_server_extensions
    self.extension_manager.link_all_extensions(self)
  File "/home/mariana/miniconda3/envs/tutorial/lib/python3.8/site-packages/jupyter_server/extension/manager.py", line 359, in link_all_extensions
    self.link_extension(name, serverapp)
  File "/home/mariana/miniconda3/envs/tutorial/lib/python3.8/site-packages/jupyter_server/extension/manager.py", line 332, in link_extension
    extension = self.extensions[name]
  File "/home/mariana/.local/lib/python3.8/site-packages/nbclassic/nbserver.py", line 80, in extensions
    nb = self._extensions.get("nbclassic")
AttributeError: 'ExtensionManager' object has no attribute '_extensions'

I wonder if it's interacting with my pip packages smh.
I tried with both mamba and conda and they're both not working.

Also, all seems good when I run the check script:

(tutorial) mariana@wintermute ~/dev/tutorial (master*?) $ python install_check.py
Checking requirements for Jupyter widget ecosystem........../home/mariana/miniconda3/envs/tutorial/lib/python3.8/site-packages/jupyter_server/transutils.py:13: FutureWarning: The alias `_()` will be deprecated. Use `_i18n()` instead.
  warnings.warn(warn_msg, FutureWarning)
.
	๐ŸŽ‰ All required packages installed
Checking voila version:
0.2.10
	๐ŸŽ‰ Voila is correctly installed
Checking version numbers of these packages:  ipywidgets, jupyterlab
	๐ŸŽ‰ ipywidgets version is good!
	๐ŸŽ‰ jupyterlab version is good!
Checking whether kernel widgets-tutorial exists
	๐ŸŽ‰ Custom kernel is correctly installed
Checking whether all Jupyter lab extensions are installed
	๐ŸŽ‰ All extensions are installed!

CondaVerificationError on attempting to create conda environment (possible Win10 issue?)

I am running from Miniconda installed on a Windows 10 Pro machine. I was able to reproduce this issue from a completely fresh install of Miniconda.

I followed the installation instructions from: https://github.com/jupyter-widgets/tutorial#installation

Git cloning was successful:
git clone https://github.com/jupyter-widgets/tutorial.git

I then attempted to create the environment, but I failed with CondaVerificationError and also saw some ClobberWarnings:

(base) PS C:\jupyter\tutorial> conda env create -f environment.yml
Collecting package metadata (repodata.json): done
Solving environment: done
Preparing transaction: done
Verifying transaction: failed

CondaVerificationError: The package for sidecar located at C:\Users\bhmiller\Miniconda3\pkgs\sidecar-0.5.1-pyhd8ed1ab_0
appears to be corrupted. The path 'share/jupyter/labextensions/@jupyter-widgets/jupyterlab-sidecar/static/vendors-node_modules_css-loader_dist_runtime_api_js-node_modules_css-loader_dist_runtime_cssW-926fd9.949facbe71846c90da88.js.map'
specified in the package manifest cannot be found.

ClobberWarning: This transaction has incompatible packages due to a shared path.
  packages: conda-forge/noarch::bqplot-0.12.29-pyhd8ed1ab_0, conda-forge/noarch::ipygany-0.5.0-pyhd8ed1ab_0
  path: 'lib/site-packages/tests/__init__.py'


ClobberWarning: This transaction has incompatible packages due to a shared path.
  packages: conda-forge/noarch::bqplot-0.12.29-pyhd8ed1ab_0, conda-forge/noarch::ipygany-0.5.0-pyhd8ed1ab_0
  path: 'lib/site-packages/tests/__pycache__/__init__.cpython-38.pyc'"

problem installing jupyter widgets

I have run through most the setup which seems to have worked well however when I get to the below step I get the following error

PS C:\Users\wfm82120\Desktop\scipy\widgets\tutorial-master> jupyter labextension install @jupyter-widgets/jupyterlab-manager @jupyter-widgets/jupyterlab-sidecar bqplot jupyte
r-threejs [email protected] ipysheet ipytree ipycanvas jupyter-matplotlib jupyter-vuetify ipyvolume
Unrecognized token in source text.
At line:1 char:30

  • jupyter labextension install <<<< @jupyter-widgets/jupyterlab-manager @jupyter-widgets/jupyterlab-sidecar bqplot jupyter-threejs [email protected] ipysheet ipytree i
    pycanvas jupyter-matplotlib jupyter-vuetify ipyvolume
    • CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
    • FullyQualifiedErrorId : UnrecognizedToken

any suggestions would be greatly appreciated

LinkError on ipywebrtc while building environment with conda

Hi,
I'm getting this error when I try install the widgets using the command given in the README

Install widgets from conda-forge
conda install -c conda-forge ipywidgets=7.2 bqplot ipyvolume ipyleaflet pythreejs ipyevents

I tried to run with it with conda 4.6.14 first and after downgrading to conda 4.5.13 after reading conda/conda#8306

I'm running debian

uname -a
Linux debian 4.9.0-9-amd64 #1 SMP Debian 4.9.168-1+deb9u2 (2019-05-13) x86_64 GNU/Linux

Regards,
Sasha

Preparing transaction: ...working... done
Verifying transaction: ...working... done
Executing transaction: ...working... ===> LINKING PACKAGE: conda-forge::traittypes-0.2.1-py_1 <===
  prefix=/home/sasha/miniconda3/envs/widgets-tutorial
  source=/home/sasha/miniconda3/pkgs/traittypes-0.2.1-py_1


===> LINKING PACKAGE: conda-forge::branca-0.3.1-py_0 <===
  prefix=/home/sasha/miniconda3/envs/widgets-tutorial
  source=/home/sasha/miniconda3/pkgs/branca-0.3.1-py_0


===> LINKING PACKAGE: conda-forge::widgetsnbextension-3.2.1-py36_1 <===
  prefix=/home/sasha/miniconda3/envs/widgets-tutorial
  source=/home/sasha/miniconda3/pkgs/widgetsnbextension-3.2.1-py36_1


Enabling notebook extension jupyter-js-widgets/extension...
      - Validating: OK

===> LINKING PACKAGE: conda-forge::ipywidgets-7.2.1-py36_1 <===
  prefix=/home/sasha/miniconda3/envs/widgets-tutorial
  source=/home/sasha/miniconda3/pkgs/ipywidgets-7.2.1-py36_1


===> LINKING PACKAGE: conda-forge::ipyevents-0.5.0-py_0 <===
  prefix=/home/sasha/miniconda3/envs/widgets-tutorial
  source=/home/sasha/miniconda3/pkgs/ipyevents-0.5.0-py_0


===> LINKING PACKAGE: conda-forge::ipyscales-0.3.0-py_0 <===
  prefix=/home/sasha/miniconda3/envs/widgets-tutorial
  source=/home/sasha/miniconda3/pkgs/ipyscales-0.3.0-py_0


===> LINKING PACKAGE: conda-forge::ipywebrtc-0.4.0-py36_1 <===
  prefix=/home/sasha/miniconda3/envs/widgets-tutorial
  source=/home/sasha/miniconda3/pkgs/ipywebrtc-0.4.0-py36_1


$ bash -x /home/sasha/miniconda3/envs/widgets-tutorial/bin/.ipywebrtc-post-link.sh
==> cwd: /home/sasha/miniconda3/envs/widgets-tutorial/bin <==
==> exit code: 1 <==
==> stdout <==
b''
==> stderr <==
b'+ /home/sasha/miniconda3/envs/widgets-tutorial/bin/jupyter-nbextension enable ipywebrtc --py --sys-prefix\nTraceback (most recent call last):\n  File "/home/sasha/miniconda3/envs/widgets-tutorial/bin/jupyter-nbextension", line 11, in <module>\n    sys.exit(main())\n  File "/home/sasha/miniconda3/envs/widgets-tutorial/lib/python3.6/site-packages/jupyter_core/application.py", line 266, in launch_instance\n    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)\n  File "/home/sasha/miniconda3/envs/widgets-tutorial/lib/python3.6/site-packages/traitlets/config/application.py", line 658, in launch_instance\n    app.start()\n  File "/home/sasha/miniconda3/envs/widgets-tutorial/lib/python3.6/site-packages/notebook/nbextensions.py", line 988, in start\n    super(NBExtensionApp, self).start()\n  File "/home/sasha/miniconda3/envs/widgets-tutorial/lib/python3.6/site-packages/jupyter_core/application.py", line 255, in start\n    self.subapp.start()\n  File "/home/sasha/miniconda3/envs/widgets-tutorial/lib/python3.6/site-packages/notebook/nbextensions.py", line 896, in start\n    self.toggle_nbextension_python(self.extra_args[0])\n  File "/home/sasha/miniconda3/envs/widgets-tutorial/lib/python3.6/site-packages/notebook/nbextensions.py", line 872, in toggle_nbextension_python\n    logger=self.log)\n  File "/home/sasha/miniconda3/envs/widgets-tutorial/lib/python3.6/site-packages/notebook/nbextensions.py", line 483, in enable_nbextension_python\n    logger=logger)\n  File "/home/sasha/miniconda3/envs/widgets-tutorial/lib/python3.6/site-packages/notebook/nbextensions.py", line 380, in _set_nbextension_state_python\n    m, nbexts = _get_nbextension_metadata(module)\n  File "/home/sasha/miniconda3/envs/widgets-tutorial/lib/python3.6/site-packages/notebook/nbextensions.py", line 1122, in _get_nbextension_metadata\n    m = import_item(module)\n  File "/home/sasha/miniconda3/envs/widgets-tutorial/lib/python3.6/site-packages/traitlets/utils/importstring.py", line 42, in import_item\n    return __import__(parts[0])\n  File "/home/sasha/miniconda3/envs/widgets-tutorial/lib/python3.6/site-packages/ipywebrtc/__init__.py", line 5, in <module>\n    from .webrtc import *\n  File "/home/sasha/miniconda3/envs/widgets-tutorial/lib/python3.6/site-packages/ipywebrtc/webrtc.py", line 12, in <module>\n    from ipywidgets import DOMWidget, Image, Video, Audio, register, widget_serialization\nImportError: cannot import name \'Video\'\n'


===> REVERSING PACKAGE LINK: conda-forge::ipywebrtc-0.4.0-py36_1 <===
  prefix=/home/sasha/miniconda3/envs/widgets-tutorial


failed
An error occurred while installing package 'conda-forge::ipywebrtc-0.4.0-py36_1'.
LinkError: post-link script failed for package conda-forge::ipywebrtc-0.4.0-py36_1
running your command again with `-v` will provide additional information
location of failed script: /home/sasha/miniconda3/envs/widgets-tutorial/bin/.ipywebrtc-post-link.sh
==> script messages <==
<None>

Attempting to roll back.


Rolling back transaction: ...working... ===> REVERSING PACKAGE LINK: conda-forge::ipyscales-0.3.0-py_0 <===
  prefix=/home/sasha/miniconda3/envs/widgets-tutorial


===> REVERSING PACKAGE LINK: conda-forge::ipyevents-0.5.0-py_0 <===
  prefix=/home/sasha/miniconda3/envs/widgets-tutorial


===> REVERSING PACKAGE LINK: conda-forge::ipywidgets-7.2.1-py36_1 <===
  prefix=/home/sasha/miniconda3/envs/widgets-tutorial


===> REVERSING PACKAGE LINK: conda-forge::widgetsnbextension-3.2.1-py36_1 <===
  prefix=/home/sasha/miniconda3/envs/widgets-tutorial


===> REVERSING PACKAGE LINK: conda-forge::branca-0.3.1-py_0 <===
  prefix=/home/sasha/miniconda3/envs/widgets-tutorial


===> REVERSING PACKAGE LINK: conda-forge::traittypes-0.2.1-py_1 <===
  prefix=/home/sasha/miniconda3/envs/widgets-tutorial


done
Traceback (most recent call last):
  File "/home/sasha/miniconda3/lib/python3.7/site-packages/conda/core/link.py", line 799, in run_script
    subprocess_call(command_args, env=env, path=dirname(path))
  File "/home/sasha/miniconda3/lib/python3.7/site-packages/conda/gateways/subprocess.py", line 56, in subprocess_call
    output=_format_output(command_str, path, rc, stdout, stderr))
subprocess.CalledProcessError: Command '['bash', '-x', '/home/sasha/miniconda3/envs/widgets-tutorial/bin/.ipywebrtc-post-link.sh']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/sasha/miniconda3/lib/python3.7/site-packages/conda/core/link.py", line 563, in _execute_actions
    run_script(target_prefix, prec, 'post-unlink' if is_unlink else 'post-link')
  File "/home/sasha/miniconda3/lib/python3.7/site-packages/conda/core/link.py", line 815, in run_script
    raise LinkError(message)
conda.exceptions.LinkError: post-link script failed for package conda-forge::ipywebrtc-0.4.0-py36_1
running your command again with `-v` will provide additional information
location of failed script: /home/sasha/miniconda3/envs/widgets-tutorial/bin/.ipywebrtc-post-link.sh
==> script messages <==
<None>


During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/sasha/miniconda3/lib/python3.7/site-packages/conda/core/link.py", line 498, in _execute
    cls._execute_actions(pkg_idx, axngroup)
  File "/home/sasha/miniconda3/lib/python3.7/site-packages/conda/core/link.py", line 579, in _execute_actions
    reverse_excs,
conda.CondaMultiError: post-link script failed for package conda-forge::ipywebrtc-0.4.0-py36_1
running your command again with `-v` will provide additional information
location of failed script: /home/sasha/miniconda3/envs/widgets-tutorial/bin/.ipywebrtc-post-link.sh
==> script messages <==
<None>



During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/sasha/miniconda3/lib/python3.7/site-packages/conda/exceptions.py", line 819, in __call__
    return func(*args, **kwargs)
  File "/home/sasha/miniconda3/lib/python3.7/site-packages/conda/cli/main.py", line 78, in _main
    exit_code = do_call(args, p)
  File "/home/sasha/miniconda3/lib/python3.7/site-packages/conda/cli/conda_argparse.py", line 77, in do_call
    exit_code = getattr(module, func_name)(args, parser)
  File "/home/sasha/miniconda3/lib/python3.7/site-packages/conda/cli/main_install.py", line 11, in execute
    install(args, parser, 'install')
  File "/home/sasha/miniconda3/lib/python3.7/site-packages/conda/cli/install.py", line 253, in install
    handle_txn(unlink_link_transaction, prefix, args, newenv)
  File "/home/sasha/miniconda3/lib/python3.7/site-packages/conda/cli/install.py", line 282, in handle_txn
    unlink_link_transaction.execute()
  File "/home/sasha/miniconda3/lib/python3.7/site-packages/conda/core/link.py", line 228, in execute
    self._execute(tuple(concat(interleave(itervalues(self.prefix_action_groups)))))
  File "/home/sasha/miniconda3/lib/python3.7/site-packages/conda/core/link.py", line 526, in _execute
    rollback_excs,
conda.CondaMultiError: post-link script failed for package conda-forge::ipywebrtc-0.4.0-py36_1
running your command again with `-v` will provide additional information
location of failed script: /home/sasha/miniconda3/envs/widgets-tutorial/bin/.ipywebrtc-post-link.sh
==> script messages <==
<None>

Set up JupyterLite session

I intend to use one of Jeremy's instances for that and go over with the users on the capabilities of JL :)
I don't think I'll add any exercises because it doesn't really add nothing new to the widgets ecosystem (AFAIK), it's just a tool that might enhance UX, etc.

Clarify that NodeJS can be installed via conda-forge

OOPS! After writing an issue about how NodeJS could be installed via conda-forge, I looked more carefully, and you are, indeed, recommending installing nodejs via conda. And the node instructions are under the "pip installation instructions". But that was pretty subtle, so maybe a bit more clarity would be in order.

While you are at it, maybe a conda_requirements file for the tutorial would be helpful, rather than passing it all in on the command line.

Error launching jupyter lab after pip install

Output from the command line is below. Inside the notebook, running the cell 9*9 never finishes.

[I 10:51:54.220 LabApp] JupyterLab extension loaded from /Users/mattcraig/miniconda3/envs/widgets-tutorial/lib/python3.8/site-packages/jupyterlab
[I 10:51:54.220 LabApp] JupyterLab application directory is /Users/mattcraig/miniconda3/envs/widgets-tutorial/share/jupyter/lab
[W 10:51:55.556 LabApp] JupyterLab server extension not enabled, manually loading...
[I 10:51:56.490 LabApp] JupyterLab extension loaded from /Users/mattcraig/miniconda3/envs/widgets-tutorial/lib/python3.8/site-packages/jupyterlab
[I 10:51:56.490 LabApp] JupyterLab application directory is /Users/mattcraig/miniconda3/envs/widgets-tutorial/share/jupyter/lab
[I 10:51:57.092 LabApp] Serving notebooks from local directory: /Users/mattcraig/development/widgets-tutorial/notebooks
[I 10:51:57.092 LabApp] The Jupyter Notebook is running at:
[I 10:51:57.092 LabApp] http://localhost:8888/?token=586b592eef9a70e808a6d9d2eab9c13e4a50af9fcbd123e6
[I 10:51:57.092 LabApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 10:51:57.104 LabApp]

    Copy/paste this URL into your browser when you connect for the first time,
    to login with a token:
        http://localhost:8888/?token=586b592eef9a70e808a6d9d2eab9c13e4a50af9fcbd123e6
[I 10:51:57.267 LabApp] Accepting one-time-token-authenticated connection from ::1
[I 10:52:02.039 LabApp] Build is up to date
[W 10:52:02.306 LabApp] Notebook 00.00-introduction.ipynb is not trusted
[I 10:52:02.845 LabApp] Kernel started: 6c5167da-339a-4180-9c61-238ad4fa7cc1
-/Users/mattcraig/miniconda3/envs/widgets-tutorial/lib/python3.8/site-packages/notebook/base/zmqhandlers.py:284: RuntimeWarning: coroutine 'WebSocketHandler.get' was never awaited
  super(AuthenticatedZMQStreamHandler, self).get(*args, **kwargs)
|[W 10:52:04.483 LabApp] Replacing stale connection: 6c5167da-339a-4180-9c61-238ad4fa7cc1:21dcd6d7-1aac-4fc4-b383-851d998c2858
\[W 10:52:04.840 LabApp] Replacing stale connection: 6c5167da-339a-4180-9c61-238ad4fa7cc1:d1427663-fd55-4219-adf5-35c7e62ca25e

bqplot version

@maartenbreddels It would be nice to show the ScatterGL plot in the bqplot example. Does it make sense to add bqplot==0.12.0-alpha.1 as dependency?

Arrange Notebooks in sub-directories

We might want to arrange Notebooks in sub-directories, putting core Notebook that we don't show in a extras directory, and Notebooks showing custom widgets libraries under an widgets_libraries directory.

Examples that fail in JupyterLab

The only failure I've found so far is this, from the "Widget Events" notebook (and the example a couple cells below it):

from IPython.display import display
button = widgets.Button(description="Click Me!")
display(button)

def on_button_clicked(b):
    print("Button clicked.")

button.on_click(on_button_clicked)

In classic, this prints "Button clicked" in the same cell as the widget. In Lab, nothing is printed. @jasongrout, is the best fix for now to put the prints into a new widget (output, or an HTML widget, or something)?

I find that pattern -- put your pdebugging-style print statements into some kind of widget you can display very useful anyway, so am inclined to go that route.

requirements: vtk==8.2.0 not found

When installing the requirements in a fresh virtual env on Windows 10, I got the following error:

ERROR: Could not find a version that satisfies the requirement vtk==8.2.0 (from versions: 9.0.0, 9.0.1, 9.0.2, 9.0.3, 9.1.0rc1, 9.1.0rc2, 9.1.0rc4, 9.1.0)
ERROR: No matching distribution found for vtk==8.2.0

I installed the latest version manually by doing pip install vtk, hopefully the tutorial will work fine :-)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.