ucberkeley / bce

Berkeley Common Environment provides a common Linux computational environment for classwork and research.
Apache License 2.0
13 stars 6 forks source link

Make Python 3.4 available in IPython notebook #40

Open davclark opened 9 years ago

davclark commented 9 years ago

Related to #38, but likely the solution is different.

Currently, if you run the IPython notebook from the application menu, you get the python 2 version, and no way to run the python 3 version. This can be set up with kernelspecs, which I learned about here:

http://stackoverflow.com/questions/28831854/how-do-i-add-python3-kernel-to-jupyter-ipython

(not sure where the official docs are.)

By default, kernelspecs are installed system-wide. The following enables python3 in the notebook for the current user only (omitting --user attempts to install to /usr/local/share/jupyter):

. activate py34
ipython kernelspec install-self --user

A similar approach can make any other python kernel always available. I guess we should do both the base miniconda 2.7 and the miniconda py34?

This could also be part of the setup_ipython_notebook.sh script, which I tend to use elsewhere as well... I'm happy to implement this, but wanted a chance to get other's feedback.

ryanlovett commented 9 years ago

Fixed by b90b4d8.

davclark commented 9 years ago

It looks like that commit just gets rid of some package installs... how does that fix availability of py34 in IPython?

ryanlovett commented 9 years ago

Sorry, I referenced the wrong commit. Updated my comment.

davclark commented 9 years ago

Please see comments on the commit (b90b4d8).

davclark commented 9 years ago

Let's leave this open until we address the issue I'm talking about - but it doesn't have to be part of the summer build. I don't have time to get into it right now.

ryanlovett commented 9 years ago

With the kernelspec install, Python2 and Python3 kernels would both be available via "ipython notebook". Is there any need for a separate menu item for a py34 "ipython notebook" menu item? My feeling is that it'd be simpler to just have the one.

davclark commented 9 years ago

I like that idea of only one notebook launcher in the menu.

D On Jun 3, 2015 3:47 PM, "Ryan Lovett" notifications@github.com wrote:

With the kernelspec install, Python2 and Python3 kernels would both be available via "ipython notebook". Is there any need for a separate menu item for a py34 "ipython notebook" menu item? My feeling is that it'd be simpler to just have the one.

Reply to this email directly or view it on GitHub https://github.com/ucberkeley/bce/issues/40#issuecomment-108611478.

davclark commented 9 years ago

I think at this point, my only gripe is I'd like to change:

Exec=/bin/bash -c 'source activate py34; ipython'

to:

Exec=~/anaconda/envs/py34/bin/ipython

But this strikes me as bike-shedding level. I feel comfortable closing the issue at this point.

cboettig commented 8 years ago

+1 I'm testing out (my build of) the Fall-2015 image, but I'm only seeing Python 2 in the notebook. Is that to be expected or did I muck something up in my build? It would really be nice to have Python 3 in Jupyter.

Thanks!

davclark commented 8 years ago

This appears to have been disabled, strangely... the relevant code is in _80-anaconda-user

ryanlovett commented 8 years ago

I'm seeing both in my build along with R. I'll push mine out to Box shortly.

Ryan

On Tue, Oct 13, 2015 at 2:38 PM, Dav Clark notifications@github.com wrote:

This appears to have been disabled, strangely... the relevant code is in _80-anaconda-user

— Reply to this email directly or view it on GitHub https://github.com/ucberkeley/bce/issues/40#issuecomment-147861620.

davclark commented 8 years ago

What branch are you building off of? I think I'm confused about where we're "supposed" to be...

ryanlovett commented 8 years ago

There should be just the one "dev" branch. Chris K. removed the master branch a few months back I believe. If you and Carl are both having the same issue then I need to find/fix the problem.

The second preview is uploading to Box now. I still need to resolve Chris P.'s issues with file size and a couple of other things. Sorry for my tardiness, I'm stretched a little thin at the moment.

Ryan

On Wed, Oct 14, 2015 at 11:24 AM, Dav Clark notifications@github.com wrote:

What branch are you building off of? I think I'm confused about where we're "supposed" to be...

— Reply to this email directly or view it on GitHub https://github.com/ucberkeley/bce/issues/40#issuecomment-148144610.

ck37 commented 8 years ago

All I did was change the default branch on github to be “dev” rather than “master”. I do think it would be ideal to move everything from dev to master and delete dev.

On Wed, Oct 14, 2015 at 11:34 AM, Ryan Lovett notifications@github.com wrote:

There should be just the one "dev" branch. Chris K. removed the master branch a few months back I believe. If you and Carl are both having the same issue then I need to find/fix the problem.

The second preview is uploading to Box now. I still need to resolve Chris P.'s issues with file size and a couple of other things. Sorry for my tardiness, I'm stretched a little thin at the moment.

Ryan

On Wed, Oct 14, 2015 at 11:24 AM, Dav Clark notifications@github.com wrote:

What branch are you building off of? I think I'm confused about where we're "supposed" to be...

— Reply to this email directly or view it on GitHub https://github.com/ucberkeley/bce/issues/40#issuecomment-148144610.

— Reply to this email directly or view it on GitHub https://github.com/ucberkeley/bce/issues/40#issuecomment-148148038.

ryanlovett commented 8 years ago

I agree!

Ryan

On Wed, Oct 14, 2015 at 11:44 AM, Chris Kennedy notifications@github.com wrote:

All I did was change the default branch on github to be “dev” rather than “master”. I do think it would be ideal to move everything from dev to master and delete dev.

On Wed, Oct 14, 2015 at 11:34 AM, Ryan Lovett notifications@github.com wrote:

There should be just the one "dev" branch. Chris K. removed the master branch a few months back I believe. If you and Carl are both having the same issue then I need to find/fix the problem.

The second preview is uploading to Box now. I still need to resolve Chris P.'s issues with file size and a couple of other things. Sorry for my tardiness, I'm stretched a little thin at the moment.

Ryan

On Wed, Oct 14, 2015 at 11:24 AM, Dav Clark notifications@github.com wrote:

What branch are you building off of? I think I'm confused about where we're "supposed" to be...

— Reply to this email directly or view it on GitHub https://github.com/ucberkeley/bce/issues/40#issuecomment-148144610.

— Reply to this email directly or view it on GitHub https://github.com/ucberkeley/bce/issues/40#issuecomment-148148038.

— Reply to this email directly or view it on GitHub https://github.com/ucberkeley/bce/issues/40#issuecomment-148153170.