尽管我付出了很多努力,但我还是无法在Canopy上为我的IPython / Jupyter笔记本安装R内核。
我密切关注以下所示的明确指示: http://www.michaelpacer.com/maths/r-kernel-for-ipython-notebook (或者,http://irkernel.github.io/installation/)
一直顺利,直到在Jupyter上安装内核的最后一步:
IRkernel::installspec()
以下是我得到的奇怪信息:
File "/Users/julien/Library/Enthought/Canopy_64bit/User/bin/jupyter-kernelspec", line 8
from jupyter_client.kernelspecapp import KernelSpecApp.launch_instance
^
SyntaxError: invalid syntax
我的配置如下:
答案 0 :(得分:3)
事实证明,文件" jupyter-kernelspec"由于某种原因被破坏了。我用以下代码替换它:
#!/usr/bin/env python
from jupyter_client.kernelspecapp import KernelSpecApp
def main():
KernelSpecApp.launch_instance()
if __name__ == '__main__':
main()
它解决了我的问题。
于连