无法在 Jupyter Notebook 中安装 R 包 [英] Cannot install R packages in Jupyter Notebook

查看:54
本文介绍了无法在 Jupyter Notebook 中安装 R 包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 Jupyter 中运行 R 代码并添加了 R 内核.大多数情况下,软件包可以成功安装.但是,某些软件包,例如 RCurlggmap,在安装时会出错.

示例:

install.packages("RCurl")

<块引用>

install.packages("RCurl") 中的警告消息:安装‘RCurl’包的退出状态非零"更新‘.Library’中包的HTML索引

制作 'packages.html' ... 完成

我该怎么办?

解决方案

在安装 RCurl 时,尝试在 install.packages 语句中指定 CRAN 作为存储库ggmap.例如:

install.packages("RCurl", repos='http://cran.us.r-project.org')

此堆栈溢出帖子位于 通过 Anaconda/Jupyter 安装 R 包超出了 R 基础中包含的包 提供了更多详细信息.

(旁注:我在尝试在计算机集群上安装 R 包时遇到了同样的问题.这个解决方案对我有用.)

I am trying to run R code in Jupyter and the R Kernel was added. Most of the time, packages can be installed successfully. However, some of the packages, such as RCurl and ggmap, would got error while installing.

Example:

install.packages("RCurl")

Warning message in install.packages("RCurl"): "installation of package ‘RCurl’ had non-zero exit status"Updating HTML index of packages in '.Library'

Making 'packages.html' ... done

What should I do?

解决方案

Try to specify CRAN as repository in your install.packages statement when installing RCurl and ggmap. For example:

install.packages("RCurl", repos='http://cran.us.r-project.org')

This Stack Overflow post on installing R packages through Anaconda/Jupyter beyond those included in R essential provides more detail.

(Side note: I had encountered the same issue when trying to install R packages on computer clusters. This solution worked for me.)

这篇关于无法在 Jupyter Notebook 中安装 R 包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆