[英]Causes of “Error: package '_____' was built before 3.0.0: please re-install it” in R
On one computer running R 2.15.2 I have installed packages from a .zip file (these packages happened to be ggplot2 and data.table , but I don't think the specific package is my issue.) Everything works fine.在一台运行 R 2.15.2 的计算机上,我从 .zip 文件安装了软件包(这些软件包碰巧是ggplot2和data.table ,但我不认为特定的软件包是我的问题。)一切正常。 I took these packages to a computer without an internet connection and installed them.
我将这些软件包带到没有互联网连接的计算机上并安装它们。 This other computer is running R 3.0.1.
另一台计算机正在运行 R 3.0.1。 The packages seemed to install without a problem (using R's "install package(s) from local zip file" option).
这些软件包似乎安装没有问题(使用 R 的“从本地 zip 文件安装软件包”选项)。 When I call the packages with the library() , I get the following error:
当我使用library()调用包时,出现以下错误:
Error: package '<insert name of newly installed package here>' was build before 3.0.0: please-re-install it
Can anyone explain potential causes for this error to be thrown?任何人都可以解释引发此错误的潜在原因吗? Are there particular directories that the .zip packages must be in for a proper install?
.zip 包是否必须位于特定目录中才能正确安装? If R is installed on a separate partition from where the .zip packages were loaded, could this cause the error?
如果 R 安装在加载 .zip 包的单独分区上,这会导致错误吗?
I'm at a loss, any pointers are greatly appreciated.我不知所措,任何指针都非常感谢。 This is a difficult one to reproduce;
这是一个很难复制的; if you need any other version/system parameters to understand the problem, please don't hesitate to ask.
如果您需要任何其他版本/系统参数来了解问题,请随时提出。
I found this solution while look at GitHub ggplot2 issue #796我在查看GitHub ggplot2 问题 #796 时找到了这个解决方案
update.packages(checkBuilt = TRUE, ask = FALSE)
It will update all the packages that need to be reinstalled.它将更新所有需要重新安装的软件包。
Running install.packages("codetools")
can fix this issue for R 3.0.2, if you have the same problem like me:运行
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’
I installed shiny according https://github.com/rstudio/shiny-server/wiki/Ubuntu-step-by-step-install-instructions我根据https://github.com/rstudio/shiny-server/wiki/Ubuntu-step-by-step-install-instructions安装了闪亮的
and got the same error at the step并在步骤中得到相同的错误
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
I tried the answer by Richard Lee by starting R我通过启动 R 尝试了 Richard Lee 的答案
R
and got the error并得到错误
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
obviously no write permission, so显然没有写权限,所以
sudo R
Now I tried again现在我又试了一次
install.packages("shiny")
and got a number of errors并得到了一些错误
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
Each time I got an error, I re-installed the requested package每次出现错误时,我都会重新安装请求的包
install.packages("codetools")
install.packages("RJSONIO")
etc.
and eventually, I was able to install Rccp, httpuv, and even shiny.最终,我能够安装 Rccp、httpuv,甚至是 Shiny。 Now it works!!
现在它起作用了!!
Also see Shiny package installation on R version 3.0.2 "Frisbee Sailing"另请参阅R version 3.0.2 "Frisbee Sailing" 上的 Shiny 软件包安装
I am using rkward on precise我正在使用rkward精确
I had a similar error using rkward .我在使用rkward 时遇到了类似的错误。 Specifically this one:
具体这个:
'lib = "/usr/local/lib/R/site-library"' is not writable
I temporarily changed the permissions for this directory so that rkward could run this from its console:我临时更改了此目录的权限,以便rkward可以从其控制台运行它:
update.packages(checkBuilt = TRUE, ask = FALSE)
all to fix this:全部解决这个问题:
Error: package '' was build before 3.0.0: please-re-install it
so that (sigh...) I could fix 'default' configuration for audio on precise.这样(叹气......)我可以精确地修复音频的“默认”配置。 I couldn't use play() etc. in rkward .
我不能在rkward 中使用play()等。
That just needed phonon-backend-gtstreamer只需要phonon-backend-gtstreamer
Here is the work-around that I used:这是我使用的解决方法:
I installed the latest version of R on an internet-capable computer.我在一台可以上网的电脑上安装了最新版本的 R。 I then loaded the my required packages (Packages->install packages->select mirror->select package...
然后我加载了我需要的包(包->安装包->选择镜像->选择包...
After R is finished installing, it displays a message of where the temporary .zip package is located. R 安装完成后,它会显示一条消息,说明临时 .zip 包所在的位置。 I navigated to this location, grabbed the temp package, and burnt it to a cd.
我导航到这个位置,获取临时包,并将其刻录到 CD。
In this way, I could get the newer package build onto a computer without internet access.通过这种方式,我可以在没有互联网访问的情况下将较新的软件包构建到计算机上。 I would still be interested to know if there is an easy way to rebuild a package downloaded on an early R version to make it compatible with the latest version (without needed an internet connection).
我仍然很想知道是否有一种简单的方法可以重建在早期 R 版本上下载的软件包,使其与最新版本兼容(无需互联网连接)。
Thanks for pointing me in the right direction @JoshuaUlrich感谢您为我指明正确的方向 @JoshuaUlrich
I tried to install swirl on R(v3.1.0) on ubuntu 12.04LTS:我尝试在 ubuntu 12.04LTS 上的 R(v3.1.0) 上安装 swirl:
sudo R
install.packages("swirl")
But faced a similar error:但是遇到了类似的错误:
Error : package 'codetools' was built before R 3.0.0: please re-install it Error : unable to load R code in package 'httr' ERROR: lazy loading failed for package 'httr' * removing '/usr/local/lib/R/site-library/httr' ERROR: dependencies 'testthat', 'httr' are not available for package 'swirl' * removing '/usr/local/lib/R/site-library/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'
Doing following helped me:做以下帮助我:
install.packages('codetools')
install.packages("swirl")
library("swirl")
swirl()
|
| Welcome to swirl!
欢迎漩涡! Please sign in. If you've been here before, use the same |
请登录。如果您以前来过这里,请使用相同的 | name as you did then.
像你当时那样命名。 If you are new, call yourself something unique.
如果您是新手,请称自己为独特的东西。 What shall I call you?
我该叫你什么?
I hope the same may help fix your installation issue.我希望同样可以帮助解决您的安装问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.