These are chat archives for ipython/ipython

21st
Aug 2015
Jessica B. Hamrick
@jhamrick
Aug 21 2015 00:25
@stefanv not sure if it matters anymore, but you probably want a —user flag
Stefan van der Walt
@stefanv
Aug 21 2015 00:25
Is that an undocumented feature?
Jessica B. Hamrick
@jhamrick
Aug 21 2015 00:26
Kernels don’t get installed in the virtualenv itself because that doesn’t make sense for non-python kernels
I don’t think so
The flag shows up if you do jupyter kernelspec install-self -h
naught101
@naught101
Aug 21 2015 10:58
Is there a nice way to run ipython locally from a git clone? for testing development?
epifanio
@epifanio
Aug 21 2015 12:33
Hi, i was looking at ipython configurable, is here any example on how to “extend“ the internal ipython configurable objects and have access to it from a code running in a cell ?
i need to detect the ipython-notebook directory and add a new directory inside (used as “cache” to store tmp files)
unless a jupiter.tmp method to generate temporary file structures (directory tree)
already exist,
Matthias Bussonnier
@Carreau
Aug 21 2015 14:01
@naught101 @epifanio with the different people travelling, moving to another countries etc, you should ask on mailing list to have a higher chance to get a response. Also it will be archive by google, and help other users.
Aaron Watters
@AaronWatters
Aug 21 2015 20:32
Hi folks. First post, sorry if it's dumb: when I install some javascript in nbextensions is that javascript always loaded for every notebook in that environment?
Stefan van der Walt
@stefanv
Aug 21 2015 20:47
@jhamrick So, what is the recommended way of installing (into my py3 virtualenv) a python 2 kernel (from my py2 virtualenv)?
Jessica B. Hamrick
@jhamrick
Aug 21 2015 20:48
The same way, I think, you’d run jupyter kernelspec install-self using the jupyter from your py2 virtualenv
You’re not actually installing it into your py3 virtualenv, you’re either installing it for the system (the default) or for a user (if you use —user)
Jason Grout
@jasongrout
Aug 21 2015 21:01
@AaronWatters - no, the javascript is just available
something has to actually load the javascript for it to be actually loaded
that said, you can register it to be automatically loaded
@stefanv - @jhamrick has a good point. The jupyter config knows nothing of python virtual envs or conda virtual envs
Min RK
@minrk
Aug 21 2015 21:04
I will add ipython kernel installfor 4.1. For now, that entry point is at python -m ipykernel.kernelspec
Jason Grout
@jasongrout
Aug 21 2015 21:05
on a related issue: I noticed today that if I launched jupyter notebook from within a conda environment, the kernel actually ran in the root conda environment
maybe we should make Conda aware of how to install a specific environment kernel
conda env install-kernel or something, that would write a kernel spec file invoking the appropriate environment, and then starting ipython
Stefan van der Walt
@stefanv
Aug 21 2015 21:10
@jasongrout I don't expect it to know. I just want it to execute the correct Python, and I want a way of registering those kernels. I still can't figure out how to do that.
@jasongrout Also seeing that permission error when installing other nbextensions, such as qgrid
@jhamrick That install-self command fails with a permission error
```
$ workon py2
$ workon py2
$ jupyter kernelspec install-self
[Errno 13] Permission denied: '/usr/local/share/jupyter'
$ which jupyter
/home/stefan/envs/py2/bin/jupyter
That's not right.
Jupyter should never write to /usr/local/share/anything
Jason Grout
@jasongrout
Aug 21 2015 21:13
it should at least support a --user option
to install to your home directory
but I don't think it does.
Stefan van der Walt
@stefanv
Aug 21 2015 21:13
It should first try .local/share/jupyter, as stated in the docs.
Jason Grout
@jasongrout
Aug 21 2015 21:13
that sounds good too.
Min RK
@minrk
Aug 21 2015 21:14
@stefanv it is doing the right thing. The default install should be usr/local, and --user should write to ~/...
Jason Grout
@jasongrout
Aug 21 2015 21:14
where does it say in the docs it tries local installs first?
Stefan van der Walt
@stefanv
Aug 21 2015 21:15
If it doesn't, at least document the --user flag.
Min RK
@minrk
Aug 21 2015 21:15
I'm not aware of any installers that default to --user.
Stefan van der Walt
@stefanv
Aug 21 2015 21:17
Sure, but how is a person supposed to discover that option?
@jasongrout The docs don't claim that, I misread: http://jupyter-client.readthedocs.org/en/latest/kernels.html
Min RK
@minrk
Aug 21 2015 21:18
Definitely need to have better docs for IPython kernel installation.
Jason Grout
@jasongrout
Aug 21 2015 21:19
jupyter kernelspec install-self -h does show the --user option
but I agree it should be much clearer
Min RK
@minrk
Aug 21 2015 21:19
Looks like what you want is
source activate py2
ipython kernelspec install-self --user
source activate py3
ipython kernelspec install-self --user
Jason Grout
@jasongrout
Aug 21 2015 21:20
We could probably also have a more helpful error message when there is a permission error, pointing to the --user option
Min RK
@minrk
Aug 21 2015 21:20
That's a good idea.
Stefan van der Walt
@stefanv
Aug 21 2015 21:20
@jasongrout But install-self is deprecated :)
Jason Grout
@jasongrout
Aug 21 2015 21:21
related issue: ipython/ipykernel#27
@minrk - what repo is handling ipython kernelspec? Is it the IPython repo, or the ipykernel repo?
Stefan van der Walt
@stefanv
Aug 21 2015 21:22
jupyter-client, I guess
Min RK
@minrk
Aug 21 2015 21:22
ipython kernelspec is just a deprecated alias for jupyter-kernelspec
The command will be ipython kernel install
Stefan van der Walt
@stefanv
Aug 21 2015 21:23
That makes sense!
Min RK
@minrk
Aug 21 2015 21:23
which is currently only accessible as python -m ipykernel.kernelspec
Jason Grout
@jasongrout
Aug 21 2015 21:23
by the way, @stefanv, here are the (obscure) docs to help in the issue: http://ipython.readthedocs.org/en/stable/install/kernel_install.html?highlight=kernelspec
Stefan van der Walt
@stefanv
Aug 21 2015 21:23
$ ipython kernelspec install --user
No source directory specified.
Jason Grout
@jasongrout
Aug 21 2015 21:25
I filed ipython/ipykernel#42
install-self
ipython kernelspec install-self --user
I still think it would be good for conda (or someone) to be able to easily make kernels for different conda envs
Stefan van der Walt
@stefanv
Aug 21 2015 21:27
Hrm, I know I'm being annoying here, but I don't understand the deprecation then.
Jason Grout
@jasongrout
Aug 21 2015 21:27
that was a mistake to deprecate that, I think
Stefan van der Walt
@stefanv
Aug 21 2015 21:27
OK, awesome--then it makes sense.
 $ ipython kernelspec install-self --user
[InstallNativeKernelSpec] Removing existing kernelspec in /home/stefan/.local/share/jupyter/kernels/python2
[InstallNativeKernelSpec] Installed kernelspec python2 in /home/stefan/.local/share/jupyter/kernels/python2
Jason Grout
@jasongrout
Aug 21 2015 21:27
That's what @minrk is saying above
Stefan van der Walt
@stefanv
Aug 21 2015 21:28
I thought he meant that jupyter kernelspec should become ipython kernelspec
Min RK
@minrk
Aug 21 2015 21:28
ipython kernelspec is deprecated, but we neglected to add the install entrypoint as a subcommand to ipython kernel, where it belongs.
Jason Grout
@jasongrout
Aug 21 2015 21:29
ah, I didn't catch that above
so ipython kernel install will be supported going forward
while ipython kernel*spec* install-self will stay deprecated
subtle...
and ipython kernel naturally is handled by the ipykernel repo?
Min RK
@minrk
Aug 21 2015 21:32
yes
Jason Grout
@jasongrout
Aug 21 2015 21:32
thanks, makes a lot of sense now
Min RK
@minrk
Aug 21 2015 21:32
The problem with not deprecating ipython kernelspec install-self is that ipython kernelspec has to be deprecated
Jason Grout
@jasongrout
Aug 21 2015 21:32
because there also is a jupyter kernelspec command?
Min RK
@minrk
Aug 21 2015 21:33
Not also, they are one in the same
ipython kernelspec is jupyter kernelspec
Jason Grout
@jasongrout
Aug 21 2015 21:33
right.
Min RK
@minrk
Aug 21 2015 21:33
So either we make a new ipython kernelspec entrypoint where everything except install-self is deprecated, or we attach the install to a non-deprecated command (i.e. ipython kernel)
Jason Grout
@jasongrout
Aug 21 2015 21:34
it makes more sense to have it in ipython kernel anyway, I think
Min RK
@minrk
Aug 21 2015 21:34
Turns out: migrating super complex applications with loads of entrypoints is hard.
Jason Grout
@jasongrout
Aug 21 2015 21:34
:)
Stefan van der Walt
@stefanv
Aug 21 2015 21:40
@minrk Is there any reason to wait to add the ipython kernel install command?
Min RK
@minrk
Aug 21 2015 21:41
No ipython/ipykernel#43
Stefan van der Walt
@stefanv
Aug 21 2015 21:42
Thank you :)
Stefan van der Walt
@stefanv
Aug 21 2015 22:02
Question by a student after Fernando's tutorial:
"I meant that the graphics were choppy because they weren't being redrawn at a high enough frame rate. Can the interactive code be optimized for faster refresh?"
Min RK
@minrk
Aug 21 2015 22:08
Good question!
That's tough.
Depending on how visuals are being produced, it is often computing the bitmap that's the most expensive step.
I'm guessing it was a matplotlib image?
The main optimizations are:
  1. cache (memoize) bitmaps so you don't recompute unnecessarily - this is still slow the first time around, but re-scans through parameters are more responsive
  2. don't use bitmaps - visualize data client-side with mpld3, bokeh, etc.
  3. make the bitmaps cheaper to calculate (highly context dependent, and not always possible)
Stefan van der Walt
@stefanv
Aug 21 2015 22:19
Awesome, thank you
Brian E. Granger
@ellisonbg
Aug 21 2015 23:49
Hmm, was it the display None bug we had/have though?