0

Despite all my efforts, I wasn't able to install the R kernel for my IPython/Jupyter notebook on Canopy.

I've closely followed the clear instructions given in: http://www.michaelpacer.com/maths/r-kernel-for-ipython-notebook (or, alternatively, http://irkernel.github.io/installation/)

All goes well until the last step that install the kernel on Jupyter:

IRkernel::installspec()

Here is the weird message I get:

File "/Users/julien/Library/Enthought/Canopy_64bit/User/bin/jupyter-kernelspec", line 8
from jupyter_client.kernelspecapp import KernelSpecApp.launch_instance
                                                      ^
SyntaxError: invalid syntax

My configuration is the following:

  • Macbook with El Capitan
  • R version 3.2.2
  • IPython 4.0.1
  • Jupyter 4.0.6
Thomas K
  • 39,200
  • 7
  • 84
  • 86
  • 1
    Your `jupyter-kernelspec` file is wrong it should say `from jupyter_client.kernelspecapp import KernelSpecApp`. Remove all and reinstall, if it persist contact Canopy. Michael blog start to date also. – Matt Feb 16 '16 at 01:58

1 Answers1

3

It turns out that the file "jupyter-kernelspec " was corrupted for some reason. I replaced it by the following code:

#!/usr/bin/env python
from jupyter_client.kernelspecapp import KernelSpecApp
def main():
    KernelSpecApp.launch_instance()
if __name__ == '__main__':
    main()

It solved my issue.

Julien

Thomas K
  • 39,200
  • 7
  • 84
  • 86