【问题标题】:IRkernel cannot find jupyter (which is installed in Anaconda) Ubuntu 16.04IRkernel 找不到 jupyter(安装在 Anaconda 中)Ubuntu 16.04
【发布时间】:2016-06-27 22:27:24
【问题描述】:

所有软件包都安装良好('pbdZMQ'、'repr'、'devtools'、'IRdisplay'、'IRkernel')。

IRkernel::installspec()

但是上面的命令给出了一个错误“必须安装 Jupyter 或 IPython 3.0”。 jupyter 安装在 Anaconda (python 2.7.11) 中,可与 Python 和 Julia 一起使用。

【问题讨论】:

  • 如果您使用 anaconda,conda install -c r r-irkernel 是获得工作 r-kernel 的最简单方法。
  • 谢谢。我安装了一个带有 jupyter & r-essentials 的 Python 3.5 环境。 conda create -n renv python=3.5conda install -n renv jupyterconda install -n renv -c r r-essentials.
  • 我遇到了同样的问题,分两步解决了。就我而言,这是一个路径问题。首先,在 RStudio 中,print(system.file("kernelspec", package = "IRkernel"))。然后,我使用输出在终端中运行它:jupyter kernelspec install --replace --name ir --user /home/lincoln/R/x86_64-pc-linux-gnu-library/3.3/IRkernel/kernelspec。使用第一个命令的输出对其进行调整。

标签: r anaconda jupyter ubuntu-16.04


【解决方案1】:

今天早上我在教程中遇到了同样的问题——在同一个平台上。

查看我的pull request to the documentation here -- 一旦我将pip / pip3 创建的bin/ 目录添加到$PATH,它就对我有用。但是,我使用的是普通的 Python,而不是过于庞大的 Anaconda 安装。

【讨论】:

  • Anaconda 将 /bin 添加到 .bashrc 的 $PATH 中。 which jupyter 指向这个目录。
  • 好点。也许你只需要(重新)获取~/.bashrc
【解决方案2】:

我最初收到与使用 Ubuntu 16.04 的 OP 相同的错误

由于@Dirk 对文档的拉取请求,我相信此注释已添加到Installation Instructions

On OS X, be sure to execute this in R started from the Terminal, not the R App!
(This is because the R app doesn’t honor $PATH changes in ~/.bash_profile)

在 Ubuntu 中从终端启动 R 后,我能够按照这些说明进行操作,因此不再收到错误消息:

install.packages(c('repr', 'IRdisplay', 'evaluate', 'crayon', 'pbdZMQ', 'devtools', 'uuid', 'digest'))
devtools::install_github('IRkernel/IRkernel')

在 R shell 中输入上述命令后,我从终端(不是 R shell)打开了 Jupyter-Notebook。 R 现在是 Python 3 的一个选项。

然后在笔记本中,我重新输入了以下命令:

install.packages(c('repr', 'IRdisplay', 'evaluate', 'crayon', 'pbdZMQ', 'devtools', 'uuid', 'digest'))
devtools::install_github('IRkernel/IRkernel')
IRkernel::installspec()

虽然前两个命令返回“非零退出状态警告”,但 IRkernel::installspec() 成功执行且没有错误。

R 现在可以在 Ubuntu 16.04 中正常运行

【讨论】:

  • 在 Ubuntu 16.04 中使用“sudo R”在终端中启动 R 后,我仍然遇到相同的错误(找不到 jupyter)
  • @RockPereira 我已更新回复以解决您的问题。看来我遇到了和你一样的错误,但是 R 仍然出现在 Jupyter 中并且现在运行正常。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2017-02-08
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-05-16
  • 1970-01-01
相关资源
最近更新 更多