Jupyterhub and interactive widgets

858 views
Skip to first unread message

Thach Nguyen

unread,
Jan 7, 2016, 12:55:08 AM1/7/16
to jup...@googlegroups.com
Hi list,
I have jupyterhub installed and running. Everything seems to work correctly except ipywidgets interactive widgets are not shown when running an ipython notebook from jupyterhub. With the same notebook, the interactive widgets are displayed correctly when not running from jupyterhub.
Is that an expected behaviour or is there something wrong with my jupyter/jupyterhub setup?
Thanks,
Thach

MinRK

unread,
Jan 7, 2016, 7:33:23 AM1/7/16
to jup...@googlegroups.com

Widgets should work fine with JupyterHub, since the Hub changes nothing about how single-user servers work in this regard. Can you share what version of everything you are using (pip list or conda list)?

-MinRK


--
You received this message because you are subscribed to the Google Groups "Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+u...@googlegroups.com.
To post to this group, send email to jup...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/CAGngho%3D7ea0NXMKMmUxaw2SDK%2B_C_%2BfObj1Fr1cqiF4mCW%3Dmmw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Thach Nguyen

unread,
Jan 7, 2016, 5:23:58 PM1/7/16
to Project Jupyter
Hi MinRK,

Here is the output of pip list:

alabaster (0.7.3)
apptools (4.2.1)
Babel (1.3)
backports-abc (0.4)
backports.ssl-match-hostname (3.4.0.2)
configobj (5.0.6)
Cython (0.20)
decorator (4.0.6)
descartes (1.0.1)
docutils (0.12)
enum34 (1.0.4)
envisage (4.4.0)
h5py (2.3.1)
ipykernel (4.1.1)
ipython (4.0.1)
ipython-genutils (0.1.0)
ipywidgets (4.1.0)
jedi (0.9.0)
Jinja2 (2.8)
jsonschema (2.4.0)
jupyter-client (4.1.1)
jupyter-core (4.0.6)
MarkupSafe (0.23)
matplotlib (1.4.3)
mayavi (4.4.0)
mistune (0.7.1)
nbconvert (4.1.0)
nbformat (4.0.1)
notebook (4.0.6)
numpy (1.9.3)
path.py (0.0.0)
pep8 (1.6.2)
pexpect (3.3)
pickleshare (0.5)
Pillow (2.7.0)
pip (7.1.2)
psutil (3.2.0)
ptyprocess (0.5)
pyface (4.4.0)
pyflakes (0.9.2)
Pygments (2.0.2)
pyparsing (2.0.3)
PySide (1.2.1)
python-dateutil (2.4.2)
pytz (2015.7)
pyzmq (15.1.0)
qtconsole (4.0.1)
rope (0.9.4)
scipy (0.14.0)
setuptools (19.1.1)
Shapely (1.5.11)
simplegeneric (0.8.1)
singledispatch (3.4.0.3)
six (1.10.0)
snowballstemmer (1.2.0)
spectral-toolbox-flow (3.0.1.dev2)
Sphinx (1.3.1)
sphinx-rtd-theme (0.1.7)
spyder (2.3.6)
terminado (0.5)
tornado (4.3)
traitlets (4.0.0)
traits (4.4.0)
traitsui (4.4.0)
VTK (5.10.1)
wheel (0.26.0)
wxPython (3.0.0.0)
wxPython-common (3.0.0.0)

and pip3 list:

apturl (0.5.2ubuntu4)
backports-abc (0.4)
Brlapi (0.6.1)
chardet (2.2.1)
checkbox-ng (0.3)
checkbox-support (0.2)
colorama (0.2.5)
command-not-found (0.3)
decorator (4.0.6)
defer (1.0.6)
feedparser (5.1.3)
friends (0.1)
html5lib (0.999)
httplib2 (0.8)
ipykernel (4.2.1)
ipython (4.0.1)
ipython-genutils (0.1.0)
Jinja2 (2.8)
jsonschema (2.5.1)
jupyter-client (4.1.1)
jupyter-core (4.0.6)
jupyterhub (0.3.0)
language-selector (0.1)
louis (2.5.3)
lxml (3.3.3)
Mako (0.9.1)
MarkupSafe (0.18)
mistune (0.7.1)
nbconvert (4.1.0)
nbformat (4.0.1)
notebook (4.0.6)
oauthlib (0.6.1)
onboard (1.0.0)
oneconf (0.3.7.14.04.1)
pamela (0.2.1)
path.py (8.1.2)
pexpect (4.0.1)
pickleshare (0.5)
pip (1.5.4)
piston-mini-client (0.7.5)
plainbox (0.5.3)
ptyprocess (0.5)
pycrypto (2.6.1)
pycurl (7.19.3)
pyflakes (0.8.1)
Pygments (2.0.2)
pygobject (3.12.0)
pyparsing (2.0.1)
python-apt (0.9.3.5ubuntu1)
python-debian (0.1.21-nmu2ubuntu2)
pyxdg (0.25)
pyzmq (15.1.0)
requests (2.2.1)
screen-resolution-extra (0.0.0)
setuptools (3.3)
simplegeneric (0.8.1)
six (1.5.2)
software-center-aptd-plugins (0.0.0)
SQLAlchemy (1.0.10)
terminado (0.5)
tornado (4.3)
traitlets (4.0.0)
ubuntu-drivers-common (0.0.0)
ufw (0.34-rc-0ubuntu2)
unattended-upgrades (0.1)
unity-scope-audacious (0.1)
unity-scope-calculator (0.1)
unity-scope-chromiumbookmarks (0.1)
unity-scope-clementine (0.1)
unity-scope-colourlovers (0.1)
unity-scope-devhelp (0.1)
unity-scope-firefoxbookmarks (0.1)
unity-scope-gdrive (0.7)
unity-scope-gmusicbrowser (0.1)
unity-scope-gourmet (0.1)
unity-scope-guayadeque (0.1)
unity-scope-manpages (0.1)
unity-scope-musique (0.1)
unity-scope-openclipart (0.1)
unity-scope-texdoc (0.1)
unity-scope-tomboy (0.1)
unity-scope-virtualbox (0.1)
unity-scope-yelp (0.1)
unity-scope-zotero (0.1)
urllib3 (1.7.1)
usb-creator (0.2.23)
wheel (0.24.0)
xdiagnose (3.6.3build2)
xkit (0.0.0)

Thanks,
Thach

Joris Van den Bossche

unread,
Jan 7, 2016, 5:29:42 PM1/7/16
to jup...@googlegroups.com
Possible reason is that you have ipywidgets installed in the python environment that the kernel of the notebook runs, but not in the (python 3) env in which jupyterhub runs.
See https://github.com/ipython/ipywidgets/issues/148. It is a quite annoying issue, as it is not directly clear why the interact fails (as ipywidgets imports just fine).

Regards,
Joris

Thach Nguyen

unread,
Jan 7, 2016, 9:43:37 PM1/7/16
to jup...@googlegroups.com
Thank you Joris for the suggestion. After installing ipywidgets to python3, interactive widgets work perfectly with Hub.
Thach


--
You received this message because you are subscribed to a topic in the Google Groups "Project Jupyter" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jupyter/n-GI5uNuHNU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jupyter+u...@googlegroups.com.

To post to this group, send email to jup...@googlegroups.com.

Phong Le

unread,
Aug 5, 2016, 1:44:03 AM8/5/16
to Project Jupyter
Hi Thach,

I have the same problem with ipywidgets. I install python3 on my Ubuntu linux (using openstack).
I also reinstall ipywidgets for python3 to use on jupyterhub as you mentioned, but the ipywidgets still doesn't work correctly. Any other suggestions?

Thanks.

Thach Nguyen

unread,
Aug 7, 2016, 8:22:41 AM8/7/16
to jup...@googlegroups.com
Hi Phong,
My issue was fixed after installing ipywidgets to both the python environment that the kernel of the notebook run as well as python3. I don't know any other tricks.
Thach

To unsubscribe from this group and all its topics, send an email to jupyter+unsubscribe@googlegroups.com.

To post to this group, send email to jup...@googlegroups.com.

Jonathan Frederic

unread,
Aug 10, 2016, 11:00:25 PM8/10/16
to jup...@googlegroups.com
Phong,

Make sure you have it installed in the correct Python environments.  Everytime I've helped someone with the problem described here it's because it's not installed in the right Python distributions, or the version installed on the kernel mismatches the ones installed in the Python distro that the server uses.  The two must match.

Cheers,
Jon

To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+unsubscribe@googlegroups.com.

To post to this group, send email to jup...@googlegroups.com.

Ludovic Ferrer

unread,
Aug 11, 2016, 6:13:23 AM8/11/16
to Project Jupyter
Dear all,
I am facing the same issue. I would like to clarify some terminologies. what do you mean by "the python version that the kernel launches" ? how could I get this information ? 
Many thanks for your help  
Cheers
Ludovic
To unsubscribe from this group and all its topics, send an email to jupyter+u...@googlegroups.com.

To post to this group, send email to jup...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+u...@googlegroups.com.
To post to this group, send email to jup...@googlegroups.com.

Thomas Kluyver

unread,
Aug 11, 2016, 9:18:40 AM8/11/16
to Project Jupyter
On 11 August 2016 at 11:13, Ludovic Ferrer <ludi...@gmail.com> wrote:
I am facing the same issue. I would like to clarify some terminologies. what do you mean by "the python version that the kernel launches" ? how could I get this information ? 

Inside a kernel, use 'sys.executable' to see which Python it's running, and 'sys.path' to see where it imports from.

If you're installing with pip, you can install into a specific version of Python using the path you get from sys.executable, as in:

path/to/python -m pip install ...

Ludovic Ferrer

unread,
Aug 31, 2016, 5:48:33 AM8/31/16
to Project Jupyter
Dear all
Thanks for your reply. 
I ran the commands in a notebook cell and get : 
/usr/local/anaconda3/bin/python3 ['', '/usr/local/anaconda3/lib/python35.zip', '/usr/local/anaconda3/lib/python3.5', '/usr/local/anaconda3/lib/python3.5/plat-linux', '/usr/local/anaconda3/lib/python3.5/lib-dynload', '/usr/local/anaconda3/lib/python3.5/site-packages', '/usr/local/anaconda3/lib/python3.5/site-packages/Sphinx-1.4.1-py3.5.egg', '/usr/local/anaconda3/lib/python3.5/site-packages/setuptools-23.0.0-py3.5.egg', '/usr/local/anaconda3/lib/python3.5/site-packages/IPython/extensions', '/home/ludoF/.ipython']

when I launch jupyterhub as a service, a ps command  get me this output : 

/usr/local/anaconda3/bin/python3.5 /usr/local/bin/jupyterhub --no-ssl --config=/etc/jupyterhub/jupyterhub_config.py


After getting into a notebook for a specific user, I get this output from a ps command: 


/usr/local/anaconda3/bin/python3.5 /usr/local/bin/jupyterhub --no-ssl --config=/etc/jupyterhub/jupyterhub_config.py


/usr/local/bin/python3.5 /usr/local/bin/jupyterhub-singleuser --user=ludo --port=35952 --cookie-name=jupyter-hub-token-ludo --base-url=/user/ludo --hub-host= --hub-prefix=/hub/ --hub-api-url=http://127.0.0.1:8081/hub/api --ip=127.0.0.1 --notebook-dir=~

As you might notice, python executables are not identical whether root or a simple users are launching. Is it what your are referring to when it is said :
 it's not installed in the right Python distributions, or the version installed on the kernel mismatches the ones installed in the Python distro that the server uses.  The two must match.

all the best.

Thomas Kluyver

unread,
Aug 31, 2016, 8:59:13 AM8/31/16
to Project Jupyter
On 31 August 2016 at 10:48, Ludovic Ferrer <ludi...@gmail.com> wrote:
As you might notice, python executables are not identical whether root or a simple users are launching. Is it what your are referring to when it is said :

Yes. The local notebook you launch directly is using Anaconda, but the notebook server launched by JupyterHub is using another copy of Python on your machine, so it won't see the installed modules in Anaconda.
Reply all
Reply to author
Forward
0 new messages