r - 无法安装软件包:pillar、devtools。无法加载:tidyverse、broom 等
问题描述
我在虚拟桌面上加载和安装软件包时遇到问题。尝试打开 tidyverse 库和其他库时,我突然遇到以下错误:
> library(tidyverse)
Error: package or namespace load failed for ‘tidyverse’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
namespace ‘broom’ 0.5.6 is being loaded, but >= 0.7.6 is required
然后我尝试加载扫帚(已安装)并收到此错误:
> library(broom)
Error: package or namespace load failed for ‘broom’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
there is no package called ‘pillar’
然后我安装柱子并得到这些消息,柱子实际上并没有下载。
> install.packages('pillar')
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:
https://cran.rstudio.com/bin/windows/Rtools/
Installing package into ‘\\norc.org/home/MD/Smith-Quincey/R/win-library/3.6’
(as ‘lib’ is unspecified)
There is a binary version available but the source version is later:
binary source needs_compilation
pillar 1.6.0 1.6.1 FALSE
installing the source package ‘pillar’
trying URL 'https://cran.rstudio.com/src/contrib/pillar_1.6.1.tar.gz'
Content type 'application/x-gzip' length 1111747 bytes (1.1 MB)
downloaded 1.1 MB
'\\norc.org\home\MD\Smith-Quincey'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported. Defaulting to Windows directory.
* installing *source* package 'pillar' ...
** package 'pillar' successfully unpacked and MD5 sums checked
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
Error in findpack(package, lib.loc) : there is no package called 'pillar'
Calls: <Anonymous> -> findpack
Execution halted
ERROR: lazy loading failed for package 'pillar'
* removing '\\norc.org/home/MD/Smith-Quincey/R/win-library/3.6/pillar'
Warning in install.packages :
installation of package ‘pillar’ had non-zero exit status
The downloaded source packages are in
‘C:\Users\smith-quincey\AppData\Local\Temp\54\Rtmpqs7eIH\downloaded_packages’
我对 devtools 有类似的问题。当我尝试安装它时,我收到以下消息:
> install.packages('devtools')
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:
https://cran.rstudio.com/bin/windows/Rtools/
Installing package into ‘\\norc.org/home/MD/Smith-Quincey/R/win-library/3.6’
(as ‘lib’ is unspecified)
also installing the dependencies ‘remotes’, ‘rversions’
There are binary versions available but the source versions are later:
binary source needs_compilation
remotes 2.3.0 2.4.0 FALSE
rversions 2.0.2 2.1.1 FALSE
devtools 2.4.1 2.4.2 FALSE
installing the source packages ‘remotes’, ‘rversions’, ‘devtools’
trying URL 'https://cran.rstudio.com/src/contrib/remotes_2.4.0.tar.gz'
Content type 'application/x-gzip' length 149836 bytes (146 KB)
downloaded 146 KB
trying URL 'https://cran.rstudio.com/src/contrib/rversions_2.1.1.tar.gz'
Content type 'application/x-gzip' length 42064 bytes (41 KB)
downloaded 41 KB
trying URL 'https://cran.rstudio.com/src/contrib/devtools_2.4.2.tar.gz'
Content type 'application/x-gzip' length 371298 bytes (362 KB)
downloaded 362 KB
'\\norc.org\home\MD\Smith-Quincey'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported. Defaulting to Windows directory.
* installing *source* package 'remotes' ...
** package 'remotes' successfully unpacked and MD5 sums checked
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
Error in findpack(package, lib.loc) :
there is no package called 'remotes'
Calls: <Anonymous> -> findpack
Execution halted
ERROR: lazy loading failed for package 'remotes'
* removing '\\norc.org/home/MD/Smith-Quincey/R/win-library/3.6/remotes'
Warning in install.packages :
installation of package ‘remotes’ had non-zero exit status
'\\norc.org\home\MD\Smith-Quincey'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported. Defaulting to Windows directory.
* installing *source* package 'rversions' ...
** package 'rversions' successfully unpacked and MD5 sums checked
** using staged installation
** R
** byte-compile and prepare package for lazy loading
Error in findpack(package, lib.loc) :
there is no package called 'rversions'
Calls: <Anonymous> -> findpack
Execution halted
ERROR: lazy loading failed for package 'rversions'
* removing '\\norc.org/home/MD/Smith-Quincey/R/win-library/3.6/rversions'
Warning in install.packages :
installation of package ‘rversions’ had non-zero exit status
'\\norc.org\home\MD\Smith-Quincey'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported. Defaulting to Windows directory.
ERROR: dependencies 'remotes', 'rversions' are not available for package 'devtools'
* removing '\\norc.org/home/MD/Smith-Quincey/R/win-library/3.6/devtools'
Warning in install.packages :
installation of package ‘devtools’ had non-zero exit status
The downloaded source packages are in
‘C:\Users\smith-quincey\AppData\Local\Temp\54\Rtmpqs7eIH\downloaded_packages’
如果您有任何指示,请告诉我。
谢谢!
解决方案
正如警告所说,您需要 Rtools 在 Windows 上从源代码安装包。首先安装 Rtools https://cran.rstudio.com/bin/windows/Rtools/,或者在询问您是否要从源代码安装时说不。
推荐阅读
- ssl - Pickle 一个 python 请求会话以在不同的应用程序运行中实现“TLS 会话恢复”
- mysql - 有没有办法用 node.js mysqldump 模块导出存储过程
- python - 使用 Python 从 lldb 中的核心文件的地址读取字符串
- laravel - 带有菜单项的动态导航栏 - 活动类
- c# - DLL 引用仅在服务器上的 NuGet 还原后有效
- powershell - 无法执行脚本来检查驱动程序的可用性并根据笔记本电脑型号进行更新
- amazon-web-services - Elastic Beanstalk AWS Powershell 迁移工具未创建应用程序,因为未选择 VPC
- kernel-module - 在 VxWorks 的 DKM 中访问 sys/select.h
- ios - Apple 分发证书已过期
- angular - ERR_FILE_NOT_FOUND 在使用 Angular 构建的 Chrome 扩展中刷新被覆盖的新标签时