【问题标题】:install R kernel into Jupyter from Canopy Python 2.7 [duplicate]从 Canopy Python 2.7 将 R 内核安装到 Jupyter [重复]
【发布时间】:2016-07-21 09:02:13
【问题描述】:

我正在尝试将 R 内核安装到 Jupyter。按照https://irkernel.github.io/installation/ 中的说明操作后,我收到以下错误消息。我使用 Enthought Canopy 和 Python 2.7。我安装了 R 并独立工作。

>IRkernel::installspec()
  File "/Users/Llewelyn_home/Library/Enthought/Canopy_64bit/User/bin/jupyter-kernelspec", line 8
    from jupyter_client.kernelspecapp import KernelSpecApp.launch_instance
                                                          ^
SyntaxError: invalid syntax

关于如何解决此问题的任何想法?

【问题讨论】:

    标签: r python-2.7 jupyter


    【解决方案1】:

    看来 installspec 调用中的代码不正确。使用 XCode 打开文件夹中的文件并进行如下编辑。关闭文件。在终端中重新运行该命令。 原文件内容为:

    if __name__ == '__main__':
        import sys
        from jupyter_client.kernelspecapp import KernelSpecApp.launch_instance
    
        sys.exit(KernelSpecApp.launch_instance())
    

    它应该读...

    感谢Installing RKernel 的澄清。我正在重新发布一个更具体的标题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-05-23
      • 1970-01-01
      • 1970-01-01
      • 2021-12-06
      • 2021-04-07
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多