These are chat archives for ipython/ipython

7th
Jan 2015
Jason Grout
@jasongrout
Jan 07 2015 00:27
@Carreau - One problem I'm finding with your suggestion for doing themes is that there is a flash of unstyled content while I'm switching the css link href. On top of that, sometimes in Chrome, switching a CSS link does nothing until you move the mouse or somehow force a redraw.
epifanio
@epifanio
Jan 07 2015 01:10
i don’t know if my issue with runing multiple kernels is a jupyter or ipython issue .. i start to have problems with jupiter but now trying to debug it i found the issue exist also on my ipython installation . what i have is : https://gist.github.com/epifanio/d10858d260e913954a49
i can’t run a python2 kernel from an ipython notebook server running python 3. the python2 kernel seems installed properly .. the log in the gist is after :
  • removing the .ipython directory
  • re-installing ipython master
  • create a new fresh profile
  • start a new server and try to run a new notebook with python2 kernel
Andreas Klostermann
@akloster
Jan 07 2015 15:16
My "ultimate" jupyter container is now running three Kernels: Python2, Python3 and R
epifanio
@epifanio
Jan 07 2015 15:17
i just did the same procedure on my laptop (osx running hombrew python) and everything works fine (py 2,3 kernel loaded and working) i
Andreas Klostermann
@akloster
Jan 07 2015 15:18
@epifanio, are you running in a container? If so, I had some problems with that too
it usually works if I don't create the container in attached/interactive mode
epifanio
@epifanio
Jan 07 2015 15:18
I’ve the problem on my server (linux debian) where previously i was running tmpnb, but now i have on it : ipython standalon+jupyterhub
i now removed all the trace of ipython from the system python (apt-get) and from my local environment
.. reinstalling from master now and see what happen. python3 -m IPython kernelspec install-self tells me : File exists: '/usr/local/share/jupyter/kernels/python3’ same for python2
Andreas Klostermann
@akloster
Jan 07 2015 15:20
also I think it's important to make sure you are referencing the right python executable
epifanio
@epifanio
Jan 07 2015 15:20
which python gaves me the one i want use : /home/epilib/Envs/env1/bin//python
Andreas Klostermann
@akloster
Jan 07 2015 15:21
when you removed ipython, probably the kernel specs were left
epifanio
@epifanio
Jan 07 2015 15:21
i’m going to remove that one too, manually then
Andreas Klostermann
@akloster
Jan 07 2015 15:21
@epifanio but the ipython process might see things differently
you may want to edit the kernelspecs
epifanio
@epifanio
Jan 07 2015 15:22
sonds a good idea, i’ll check in the ipython src code what to edit
Andreas Klostermann
@akloster
Jan 07 2015 15:22
I consider the "kernel management" functions of IPython to be just "a good start"... I had to change some stuff too, especially for the R kernel to work in my setup.
@epifanio you won't find it there... try the kernel.json in /usr/local/share/jupyter/kernels
epifanio
@epifanio
Jan 07 2015 15:23
@akloster thanks! looking into it now. i hope to fix py2,3 issues on the server soon, i need to add R and octave too
Andreas Klostermann
@akloster
Jan 07 2015 15:23
it's probably referring to some executable on your path which may or may not turn out as you intend it
@epifanio use install_github('rgbkrk/rzmq', ref="c++11") instead of the rzmq that is documented in the IRkernel Readme
if you are using debian, the other repo might work, but for ubuntu I had to use that fork because of some compiler flag hiccup
epifanio
@epifanio
Jan 07 2015 15:26
a “locate kernel.json” is giving me a lot of confused/mixed stuff that i should clean-up : https://gist.github.com/4c0a72008152d45409f1 i think that’s why i got things broken
i was using a non custom ipython-directory
i’ll clean this too and start for scratch
Andreas Klostermann
@akloster
Jan 07 2015 15:27
I have a suspicion this kernel management stuff will change in the future
it works great as it is, but I suspect a lot of people will have trouble with setting up their IPython installations
epifanio
@epifanio
Jan 07 2015 15:32
now that i removed all the ipython installation from system python, when i load the notebook and try the kernel py2 .. i got a “clear” traceback https://gist.github.com/1106f73e839bf7e0ee45
it is trying with system python !
Andreas Klostermann
@akloster
Jan 07 2015 15:34
@epifanio you seem to have pressed ctrl-c
epifanio
@epifanio
Jan 07 2015 15:34
yes
after the py2 kernel died
Andreas Klostermann
@akloster
Jan 07 2015 15:34
just edit the kernel.json file in your system folder to use a specific executable
epifanio
@epifanio
Jan 07 2015 15:34
weird ipython is still there after i removed it
Andreas Klostermann
@akloster
Jan 07 2015 15:35
are you sure you are not mixing up ports?
epifanio
@epifanio
Jan 07 2015 15:38
@akloster thank you so much .. modify the kernel.spec to point to the right python executable fixed the problem!
Andreas Klostermann
@akloster
Jan 07 2015 15:39
@akloster good to hear!
epifanio
@epifanio
Jan 07 2015 15:39
it was pointing to /usr/bin
Andreas Klostermann
@akloster
Jan 07 2015 15:39
I can't count the number of times I mixed up python interpreters
epifanio
@epifanio
Jan 07 2015 15:40
but in installation step i used the full path to my local python executable
so i guessesd it was using it
Andreas Klostermann
@akloster
Jan 07 2015 15:40
that may be worth a bug report
epifanio
@epifanio
Jan 07 2015 15:40
glad to have it back working!
Andreas Klostermann
@akloster
Jan 07 2015 15:41
on the other hand the process running the self-kernel installation may not be aware of the specific interpreter location
epifanio
@epifanio
Jan 07 2015 15:41
on osx my python is in /usr/local .. thios can explain why it works wothout changes
what should I do to add R kernel in the kernel menu, after “install_github('rgbkrk/rzmq', ref="c++11”)" ?
epifanio
@epifanio
Jan 07 2015 15:46
maybe this line does it : IRkernel::installspec()
Andreas Klostermann
@akloster
Jan 07 2015 15:46
it would
but only if your ipython executable works ;-)
so either you need to symlink ipython to your ipython3 thing or you need to adapt the installspec function
anyway:
srcdir = system.file("kernelspec", package="IRkernel")
cmd = paste("/conda3/bin/ipython kernelspec install --replace --name ir", srcdir, sep=" ")
system(cmd, wait=TRUE)
of course you need to adapt that
epifanio
@epifanio
Jan 07 2015 15:52
it worked aout of box :) i followed https://github.com/takluyver/IRkernel now R is back alive tested it works
@akloster thanks a lot to help me!
Andreas Klostermann
@akloster
Jan 07 2015 15:57
no problem
epifanio
@epifanio
Jan 07 2015 16:20
octave kernel also works as expected, while bash kernel (after apply the pr to update setup.py) requires the change to the ipython exectuable in the kernel.spec (as we did for python2/3) but also with that change try to load a bash kernel gave this error : https://gist.github.com/195b0d6b983c5f87aa18 (mybe the installation of bash_kernel which requires sudo .. is incomplete when using “non sudo: python setup.py install")
Andreas Klostermann
@akloster
Jan 07 2015 16:22
@epifanio it looks more like a problem of either an old/missing version of pexpect package or a bug in the kernel
I'm currently working on adding the julia kernel to my container
epifanio
@epifanio
Jan 07 2015 16:24
right .. it was a missed pexpect
bash works fine now
Andreas Klostermann
@akloster
Jan 07 2015 17:29
does anybody have a kernelspec for IJulia? looking at the source it doesn't provide a kernel-install method
Thomas Kluyver
@takluyver
Jan 07 2015 17:30
I think @Carreau has a PR open to add one
here we are: JuliaLang/IJulia.jl#210
Andreas Klostermann
@akloster
Jan 07 2015 17:32
thank you
epifanio
@epifanio
Jan 07 2015 17:32
@akloster in the jupyter/tmpnb demo there was a running julia kernel but it seems to install the kernel spec in the user profile
Andreas Klostermann
@akloster
Jan 07 2015 17:58
hm, both hints don't help me enough, because I don't speak Julia yet. I don't know how to install from the fork and I can't find the json file
Min RK
@minrk
Jan 07 2015 18:04
This is my julia kernel.json:
{
 "argv": [
  "/usr/local/bin/julia",
  "-i",
  "-F",
  "/Users/minrk/.julia/IJulia/src/kernel.jl",
  "{connection_file}"
 ],
 "display_name": "Julia"
}
Thomas Wiecki
@twiecki
Jan 07 2015 18:07
although I deleted the kernel directory for python 3, I still see that kernel in the NB. where is it read from?
Min RK
@minrk
Jan 07 2015 18:07
A kernel with the same Python as the server is always available
Thomas Wiecki
@twiecki
Jan 07 2015 18:08
ah, that's the issue then
any way to disable that?
Thomas Kluyver
@takluyver
Jan 07 2015 18:08
not at present. Why do you want to?
Thomas Wiecki
@twiecki
Jan 07 2015 18:08
I have set up a python 2 environment
so users (jupyterhub) always have to remember to switch the kernel
just not good UX
Min RK
@minrk
Jan 07 2015 18:09
@twiecki you can set the default kernel to anything you want
Thomas Wiecki
@twiecki
Jan 07 2015 18:09
@minrk how?
Andreas Klostermann
@akloster
Jan 07 2015 18:09
@minrk thank you
epifanio
@epifanio
Jan 07 2015 18:09
maybe i’m wrong, but seems to me that when running the julia installer it generate a kernel inside the profile directory for the user, then that user is the only one able to run julia (on a multiuser jupiter notebook i’m not sure all the user will have julia available)
Min RK
@minrk
Jan 07 2015 18:10
@epifanio yes, if a kernelspec is installed to .ipython/kernels, then only that user has it. If it's installed to /usr/local/share/jupyter/kernels then all users have it
Andreas Klostermann
@akloster
Jan 07 2015 18:10
@epifanio just copy the kernel spec to a global dir
epifanio
@epifanio
Jan 07 2015 18:11
i tried that and it is restarting the kernel all the time, like something else is wrong. in the .jl file it points to some julia libs installed in the .julia directorry in the home
Thomas Kluyver
@takluyver
Jan 07 2015 18:12
the libraries for IJulia also need to be installed systemwide if it's to work for other users
Min RK
@minrk
Jan 07 2015 18:12
@twiecki MultiKernelManager.default_kernel_name = 'python2'
Thomas Wiecki
@twiecki
Jan 07 2015 18:15
@minrk ~/.ipython/profile_default/nbconfig/tree.json ?
Min RK
@minrk
Jan 07 2015 18:16
No, ipython_notebook_config.py
The UI config for a user-specified default kernel was removed, only the kernel-side value remains
Thomas Wiecki
@twiecki
Jan 07 2015 18:17
I don't have that file
is ist in profile_default or nbconfig subdir?
Min RK
@minrk
Jan 07 2015 18:17
profile_default
ipython profile create
Thomas Wiecki
@twiecki
Jan 07 2015 18:17
thx
epifanio
@epifanio
Jan 07 2015 18:24
this is how the julia kernel is configured as root : https://gist.github.com/c87b56987fd876b53576 but logging in jupyter as user X ends in a died/restarting kernel when julia is selected. i don’t know how to read jupiterhub logs .. so i tried to run a singleuser ipython notebook and this is the shell log when the ‘julia’ kernel is selected : https://gist.github.com/7207c614376b23285a18
Andreas Klostermann
@akloster
Jan 07 2015 18:55
@epifanio well, if the user the IPython Kernel process is running under does not have read/execute permissions on that file, it probably won't work
epifanio
@epifanio
Jan 07 2015 18:59
i see , so should i change the permision in /usr/local/share/jupyter/kernels/julia to allow all users read/execute
Thomas Kluyver
@takluyver
Jan 07 2015 19:00
only needs to be readable, I think
Jason Grout
@jasongrout
Jan 07 2015 19:15
@takluyver, @sylvaincorlay and I were talking about recent changes in how kernel/languages are displayed in the notebook
if I understand things correctly, the language (or is the kernel?) is set at creation time. Can I change a notebook between different kernels implementing the same language? (for example, several different python 2 installs)?
Min RK
@minrk
Jan 07 2015 19:30
@jasongrout yes, you can change the kernel from the Kernel menu
we took out the prominant button for switching kernels, since it didn't seem appropriate for the relative obscurity of the action, but the action remains available under the Kernel menu
Jason Grout
@jasongrout
Jan 07 2015 20:01
ah, under the kernel menu.
great; found it.
I think the only other thing is that the kernel icon is too distracting, and hardly useful, I think. A big bright python icon is great if I need to see at a glance some information (what kernel I'm using). But typically, you only need that information once, and it is already provided, and after that, it's just a pretty loud splash of color that rivals the notifications that communicates nothing. (And I like my bike sheds blue too :)
Min RK
@minrk
Jan 07 2015 20:07
You are welcome to use any kernel logos you like, including having none at all
Jason Grout
@jasongrout
Jan 07 2015 20:08
right, of course I have control over the kernel specs... Okay, let me just register the opinion that the default python logo is too loud for the notebook.
Min RK
@minrk
Jan 07 2015 20:08
consider it registered
Jason Grout
@jasongrout
Jan 07 2015 20:08
thanks :)
:)
Min RK
@minrk
Jan 07 2015 20:09
there's probably a way to apply a desaturation pass with css
Jason Grout
@jasongrout
Jan 07 2015 20:11
right. I'm sure there is.
Jason Grout
@jasongrout
Jan 07 2015 20:18
played with desaturation -- I think I still don't like even the image there, since it's redundant and not as specific as the text. Anyways, that's my vote.
Min RK
@minrk
Jan 07 2015 20:24
Fair enopugh
Jason Grout
@jasongrout
Jan 07 2015 22:22
If I have an html file in a directory that the notebook is serving, and I click on the html file, the notebook should just serve that file as a plain html file (e.g., 127.0.0.1:8888/files/path/to/file.html), right?
instead, it seems to send me to the /edit/path/to/file.html URL, which it doesn't quite seem to know how to handle.
Thomas Kluyver
@takluyver
Jan 07 2015 22:26
the way it works at present, any file that it can decode as UTF-8 text will be opened in the text editor
Jason Grout
@jasongrout
Jan 07 2015 22:30
ah, that explains it.
it would be really nice if there was an easy way to open an html file as an html file. Then it would be easier to browse documentation, etc.
Min RK
@minrk
Jan 07 2015 22:39
One level: add a button that does whatever clicking the name doesn't (view or edit)
Another: add a 'view raw' link from the edit page, so it would be two clicks away, but at least accessible without modifying URLs
Jason Grout
@jasongrout
Jan 07 2015 22:59
view raw would also be really nice for ipython notebooks to be able to easily cut and paste lots of cells.
Min RK
@minrk
Jan 07 2015 23:00
I would use edit for that
Hamid Tavakoli
@hamidre13
Jan 07 2015 23:49
Hi @minrk ,I have python function that returns '17\n17\n17\n17\n17\n17\n' . I cannot figure out which character should I replace with \n to get a new line?
Min RK
@minrk
Jan 07 2015 23:59
'\n' is a newline
If you want to see it as one, print the string instead of its repr
Hamid Tavakoli
@hamidre13
Jan 07 2015 23:59
But it prints it like: 17\n17\n17\n17\n17\n17\n