【问题标题】:Juypter notebook can't find R kernel on El Capitan public betaJupyter notebook 在 El Capitan 公测版上找不到 R 内核
【发布时间】:2015-07-14 00:16:13
【问题描述】:

我在备用计算机上安装了 El Capitan 测试版以进行测试,以便在我们的数据科学团队中的其他人在今年秋天某个时候发布最终版本后升级他们的日常机器之前找出潜在问题(注意:我可以导航围绕 Unix,但我远非 Mac 程序员)。 python 2 和 3 的内核工作得很好,但是当我尝试加载 R 内核时,我收到以下消息:

从 Jupyter 笔记本本身我得到:

Traceback (most recent call last):
  File "/Users/test/anaconda/lib/python3.4/site-packages/IPython/html/base/handlers.py", line 365, in wrapper
    result = yield gen.maybe_future(method(self, *args, **kwargs))
  File "/Users/test/anaconda/lib/python3.4/site-packages/IPython/html/services/sessions/handlers.py", line 53, in post
    model = sm.create_session(path=path, kernel_name=kernel_name)
  File "/Users/test/anaconda/lib/python3.4/site-packages/IPython/html/services/sessions/sessionmanager.py", line 66, in create_session
    kernel_name=kernel_name)
  File "/Users/test/anaconda/lib/python3.4/site-packages/IPython/html/services/kernels/kernelmanager.py", line 84, in start_kernel
    kernel_name=kernel_name, **kwargs)
  File "/Users/test/anaconda/lib/python3.4/site-packages/IPython/kernel/multikernelmanager.py", line 112, in start_kernel
    km.start_kernel(**kwargs)
  File "/Users/test/anaconda/lib/python3.4/site-packages/IPython/kernel/manager.py", line 240, in start_kernel
    **kw)
  File "/Users/test/anaconda/lib/python3.4/site-packages/IPython/kernel/manager.py", line 189, in _launch_kernel
    return launch_kernel(kernel_cmd, **kw)
  File "/Users/test/anaconda/lib/python3.4/site-packages/IPython/kernel/launcher.py", line 213, in launch_kernel
    proc = Popen(cmd, **kwargs)
  File "/Users/test/anaconda/lib/python3.4/subprocess.py", line 859, in __init__
    restore_signals, start_new_session)
  File "/Users/test/anaconda/lib/python3.4/subprocess.py", line 1457, in _execute_child
    raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: 'R'

我在终端中收到以下错误消息。

[E 19:44:58.862 NotebookApp] Unhandled error in API request
    Traceback (most recent call last):
      File "/Users/test/anaconda/lib/python3.4/site-packages/IPython/html/base/handlers.py", line 365, in wrapper
        result = yield gen.maybe_future(method(self, *args, **kwargs))
      File "/Users/test/anaconda/lib/python3.4/site-packages/IPython/html/services/sessions/handlers.py", line 53, in post
        model = sm.create_session(path=path, kernel_name=kernel_name)
      File "/Users/test/anaconda/lib/python3.4/site-packages/IPython/html/services/sessions/sessionmanager.py", line 66, in create_session
        kernel_name=kernel_name)
      File "/Users/test/anaconda/lib/python3.4/site-packages/IPython/html/services/kernels/kernelmanager.py", line 84, in start_kernel
        kernel_name=kernel_name, **kwargs)
      File "/Users/test/anaconda/lib/python3.4/site-packages/IPython/kernel/multikernelmanager.py", line 112, in start_kernel
        km.start_kernel(**kwargs)
      File "/Users/test/anaconda/lib/python3.4/site-packages/IPython/kernel/manager.py", line 240, in start_kernel
        **kw)
      File "/Users/test/anaconda/lib/python3.4/site-packages/IPython/kernel/manager.py", line 189, in _launch_kernel
        return launch_kernel(kernel_cmd, **kw)
      File "/Users/test/anaconda/lib/python3.4/site-packages/IPython/kernel/launcher.py", line 213, in launch_kernel
        proc = Popen(cmd, **kwargs)
      File "/Users/test/anaconda/lib/python3.4/subprocess.py", line 859, in __init__
        restore_signals, start_new_session)
      File "/Users/test/anaconda/lib/python3.4/subprocess.py", line 1457, in _execute_child
        raise child_exception_type(errno_num, err_msg)
    FileNotFoundError: [Errno 2] No such file or directory: 'R'
[E 19:44:58.870 NotebookApp] {
      "Accept-Language": "en-US,en;q=0.8",
      "Content-Length": "72",
      "Accept": "application/json, text/javascript, */*; q=0.01",
      "Dnt": "1",
      "X-Requested-With": "XMLHttpRequest",
      "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
      "Origin": "http://localhost:8888",
      "Referer": "http://localhost:8888/notebooks/Untitled4.ipynb?kernel_name=ir",
      "Accept-Encoding": "gzip, deflate",
      "Connection": "keep-alive",
      "Host": "localhost:8888",
      "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.132 Safari/537.36"
    }
[E 19:44:58.870 NotebookApp] 500 POST /api/sessions (::1) 25.54ms referer=http://localhost:8888/notebooks/Untitled4.ipynb?kernel_name=ir
[I 20:04:04.914 NotebookApp] Creating new notebook in
[I 20:04:05.707 NotebookApp] Kernel started: 75ef1aa5-453d-4a18-94df-eae30238c688

我的第一个想法是尝试重新安装 R 内核(及其依赖项),但这些依赖项必须从它们的二进制文件编译并需要 Xcode(没有公开测试版)。有谁知道这方面的潜在解决方法(或者对从哪里开始寻找有任何想法)?我试图弄清楚这是否是我们可以自己解决的问题,或者我们是否可能需要等待 Jupyter 小组的官方修复。提前致谢。

【问题讨论】:

  • @BondedDust “R”内核让 jupyter notebook(改进的 IPython 笔记本)用户可以创建与 python 笔记本一样工作的“R”笔记本。但是,当然,这可能是 Ask DifferentSuper User 的问题。
  • 嗯,我还没有看到任何关于在 El Capitan 上测试“R 内核”的通知。如果声明还没有 XCode 发布,那就可以解释了。
  • @scribbles 你真的需要 Xcode 7 beta 3 来尝试这个。我什至不知道zmq 是否在 El Capitan 下工作,这是一个先决条件(您的组织必须能够为会员提供小额美元 ;-)。如果我是你,我会推迟这个。 homebrew 当前有 8 open issues 标记为 10.11(这意味着还有更多)。
  • @hrbrmstr 感谢您的回复。我认为可能需要 Xcode。开发人员帐户很便宜,并且可以毫无问题地使用它,但是工时很快就会变得昂贵。我不想浪费一两天的时间来尝试解决我自己可能无法解决的问题。 zmq 在 Yosemite 中已经存在问题,所以如果它不起作用我不会感到震惊,但我什至没有考虑过自制软件。我认为这足以让我暂时搁置它

标签: r jupyter osx-elcapitan


【解决方案1】:

能够让这个工作。更新到 beta 与 R $PATH 以及 homebrew 及其依赖项混为一谈。采取以下步骤解决了我遇到的所有问题。

1) Reinstall Revolution R Open(或您首选的 R 安装。我喜欢 RRO,因为它包含英特尔 MKL - 数学内核库)

2) 修复 Homebrew 权限:

$ sudo chown -R "$USER":admin /usr/local

3) 清理 Homebrew 安装:

$ rm -rf /usr/local/Cellar /usr/local/.git && brew cleanup

4) 重新安装 Homebew:

$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

5) 安装 OS X 命令行工具(如果尚未安装):

$ xcode-select --install

6) 安装zqm:

$ brew install zmq

7) 在终端中启动 R

$R

8) 运行以下命令:

install.packages(c('rzmq','repr','IRkernel','IRdisplay'),
                 repos = c('http://irkernel.github.io/', getOption('repos')),
                 type = 'source')
IRkernel::installspec()

现在应该可以打开一个新的终端窗口并启动 jupyter。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-10-02
    • 1970-01-01
    • 1970-01-01
    • 2023-01-13
    • 1970-01-01
    • 2021-02-06
    • 1970-01-01
    • 2016-11-03
    相关资源
    最近更新 更多