These are chat archives for ipython/ipython

12th
May 2016
Tyler Reddy
@tylerjereddy
May 12 2016 14:43
I've found it pretty challenging to get ipywidgets to work in Jupyter notebooks running the Python 2 kernel in docker containers (for an upcoming PyCon tutorial). Is this normal? I've tried using i.e., the "RUN jupyter nbextension enable --py widgetsnbextension --sys-prefix" Dockerfile command present in some of the official docker-stacks Dockerfiles and even running that command directly in the notebook (!command) itself with python2 sourced doesn't enable the widgets. I've tried switching ipywidgets version between the 4.x and 5.x series without success. On startup, the notebook will typically indicate that either the widgets aren't installed or there will be a 404 GET on /nbextensions/widgets. The Dockerfile is in the root of the repo here (https://github.com/tylerjereddy/pycon-2016 ) if you have a minute for suggestions. Thanks.
Jason Grout
@jasongrout
May 12 2016 15:05
what version of the notebook are you using?
4.2?
@tylerjereddy
Adrian
@ThiefMaster
May 12 2016 15:14
what does ipython5 use to determine which color scheme to use for syntax highlighting? when i installed the git version a week or so ago i got a nice colorscheeme that looked 256color-based ($TERM is screen-256color), i updated to the latest git version today and it's using rather ugly colors now (looks bright-bg optimized and using only the basic xterm colors)
Steven Silvester
@blink1073
May 12 2016 15:16
I think it is a result of the switch to prompt-toolkit. I’d suggest posting an issue on either https://github.com/ipython/ipython or https://github.com/jupyter/help
Adrian
@ThiefMaster
May 12 2016 15:20
@blink1073 : The last version I had was already using prompt-toolkit
That's why i switched to the git version after all
Steven Silvester
@blink1073
May 12 2016 15:22
gotcha. The point stands that questions are more readily answered on Github
Min RK
@minrk
May 12 2016 15:22
I think the version of prompt-toolkit may have changed, which could be relevant. A GitHub question will get you better results.
The pt stuff is all very new, and changing quite a bit.
Adrian
@ThiefMaster
May 12 2016 15:27
ok, i'll try to figure out where the problem was introduced and open an issue
Looks like ipython/ipython@3aa7df6 is the commit where the colors changed
Adrian
@ThiefMaster
May 12 2016 15:33
(huh, i thought gitter links commits automatically?)
Tyler Reddy
@tylerjereddy
May 12 2016 15:51
@jasongrout notebook version is 4.20 [running on Python 3.5.1]; kernel is Python 2.7.11 / IPython 4.2.0
Jason Grout
@jasongrout
May 12 2016 15:55
and you installed the latest ipywidgets from pip? Can you get us a sequence of commands to reproduce the error (preferably with the latest ipywidgets from pip)
I see your Docker file from above
you have "ipywidgets=4.0"
Conda doesn't have the current ipywidgets 5.x releases yet
instead of installing ipywidgets from conda, can you take out that line and instead do pip install ipywidgets
and then the jupyter nbextension enable --sys-prefix --py widgetsnbextension
Adrian
@ThiefMaster
May 12 2016 15:59
Ah, the color "issue" is actually a feature. Setting c.TerminalInteractiveShell.highlighting_style to a pygments style name solved it
Jason Grout
@jasongrout
May 12 2016 15:59
@tylerjereddy or even better, it looks like someone (@SylvainCorlay?) uploaded the newest ipywidgets to conda forge. So this should work: conda install -c conda-forge ipywidgets=5.1.3
(but you still have to do the enable command)
Jason Grout
@jasongrout
May 12 2016 16:06
actually, you don't have to do the enable command, it's take care of for you
so it should be sufficient to do conda install -c conda-forge ipywidgets=5.1.3, and then things should just work.
Tyler Reddy
@tylerjereddy
May 12 2016 16:43
@jasongrout ipywidgets 5.1.3 clearly installed in the Jupyter notebook using the latter conda install route, but IPKernelApp is complaining about the lack of the enabling command you mentioned above. I'll try adding that to the Dockerfile as well (note that I had already tried various permutations of the enabling command & ipywidgets versions with little success). I'll see if this works.
Stephen W. Nuchia
@swn1
May 12 2016 22:18
Is there a quick way to generate a stream packet with other than stdout as content/name? testing an ad-hoc client event loop and would like to cover that branch.