![](/img/trans.png)
[英]Failed with error: ‘package ‘sentiment’ was built before R 3.0.0: please re-install it’
[英]Causes of “Error: package '_____' was built before 3.0.0: please re-install it” in R
在一台运行 R 2.15.2 的计算机上,我从 .zip 文件安装了软件包(这些软件包碰巧是ggplot2和data.table ,但我不认为特定的软件包是我的问题。)一切正常。 我将这些软件包带到没有互联网连接的计算机上并安装它们。 另一台计算机正在运行 R 3.0.1。 这些软件包似乎安装没有问题(使用 R 的“从本地 zip 文件安装软件包”选项)。 当我使用library()调用包时,出现以下错误:
Error: package '<insert name of newly installed package here>' was build before 3.0.0: please-re-install it
任何人都可以解释引发此错误的潜在原因吗? .zip 包是否必须位于特定目录中才能正确安装? 如果 R 安装在加载 .zip 包的单独分区上,这会导致错误吗?
我不知所措,任何指针都非常感谢。 这是一个很难复制的; 如果您需要任何其他版本/系统参数来了解问题,请随时提出。
我在查看GitHub ggplot2 问题 #796 时找到了这个解决方案
update.packages(checkBuilt = TRUE, ask = FALSE)
它将更新所有需要重新安装的软件包。
运行install.packages("codetools")
可以解决 R 3.0.2 的这个问题,如果你有和我一样的问题:
installing to /home/user/R/x86_64-pc-linux-gnu-library/3.0/Rcpp/libs
** R
** inst
** preparing package for lazy loading
Error : package ‘**codetools**’ was built before R 3.0.0: please re-install it
Error : unable to load R code in package ‘Rcpp’
ERROR: lazy loading failed for package ‘Rcpp’
我根据https://github.com/rstudio/shiny-server/wiki/Ubuntu-step-by-step-install-instructions安装了闪亮的
并在步骤中得到相同的错误
sudo su - -c "R -e \"install.packages('shiny', repos='http://cran.rstudio.com/')\""
Warning messages:
1: In install.packages("shiny", repos = "http://cran.rstudio.com/") :
installation of package ‘Rcpp’ had non-zero exit status
2: In install.packages("shiny", repos = "http://cran.rstudio.com/") :
installation of package ‘httpuv’ had non-zero exit status
3: In install.packages("shiny", repos = "http://cran.rstudio.com/") :
installation of package ‘shiny’ had non-zero exit status
我通过启动 R 尝试了 Richard Lee 的答案
R
并得到错误
Warning in install.packages("shiny") :
'lib = "/usr/local/lib/R/site-library"' is not writable
Would you like to use a personal library instead? (y/n) n
Error in install.packages("shiny") : unable to install packages
显然没有写权限,所以
sudo R
现在我又试了一次
install.packages("shiny")
并得到了一些错误
Error : package ‘codetools’ was built before R 3.0.0: please re-install it
Error : package ‘RJSONIO’ was built before R 3.0.0: please re-install it
Error : package ‘caTools’ was built before R 3.0.0: please re-install it
Error : package ‘bitops’ was built before R 3.0.0: please re-install it
Error : package ‘digest’ was built before R 3.0.0: please re-install it
Error : package ‘xtable’ was built before R 3.0.0: please re-install it
每次出现错误时,我都会重新安装请求的包
install.packages("codetools")
install.packages("RJSONIO")
etc.
最终,我能够安装 Rccp、httpuv,甚至是 Shiny。 现在它起作用了!!
我正在使用rkward精确
我在使用rkward 时遇到了类似的错误。 具体这个:
'lib = "/usr/local/lib/R/site-library"' is not writable
我临时更改了此目录的权限,以便rkward可以从其控制台运行它:
update.packages(checkBuilt = TRUE, ask = FALSE)
全部解决这个问题:
Error: package '' was build before 3.0.0: please-re-install it
这样(叹气......)我可以精确地修复音频的“默认”配置。 我不能在rkward 中使用play()等。
只需要phonon-backend-gtstreamer
这是我使用的解决方法:
我在一台可以上网的电脑上安装了最新版本的 R。 然后我加载了我需要的包(包->安装包->选择镜像->选择包...
R 安装完成后,它会显示一条消息,说明临时 .zip 包所在的位置。 我导航到这个位置,获取临时包,并将其刻录到 CD。
通过这种方式,我可以在没有互联网访问的情况下将较新的软件包构建到计算机上。 我仍然很想知道是否有一种简单的方法可以重建在早期 R 版本上下载的软件包,使其与最新版本兼容(无需互联网连接)。
感谢您为我指明正确的方向 @JoshuaUlrich
我尝试在 ubuntu 12.04LTS 上的 R(v3.1.0) 上安装 swirl:
sudo R
install.packages("swirl")
但是遇到了类似的错误:
错误:包“codetools”是在 R 3.0.0 之前构建的:请重新安装 错误:无法在包“httr”中加载 R 代码错误:包“httr”的延迟加载失败 * 删除“/usr/local/lib” /R/site-library/httr' 错误:依赖项 'testthat'、'httr' 不可用于包 'swirl' * 删除 '/usr/local/lib/R/site-library/swirl'
做以下帮助我:
install.packages('codetools')
install.packages("swirl")
library("swirl")
swirl()
| 欢迎漩涡! 请登录。如果您以前来过这里,请使用相同的 | 像你当时那样命名。 如果您是新手,请称自己为独特的东西。 我该叫你什么?
我希望同样可以帮助解决您的安装问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.