当前位置: 首页 > 工具软件 > Haven > 使用案例 >

【R语言】安装tidyverse时,遇报错:ERROR: dependencies ‘haven‘, ‘readr‘ are not available for package ‘tidyverse‘

丁成弘
2023-12-01

安装tidyverse时,遇到如下报错:

ERROR: dependencies 'haven', 'readr' are not available for package 'tidyverse'

于是,去安装 ‘haven’ 依赖包。

install.packages("haven")

又出现报错:

** R
** inst
** byte-compile and prepare package for lazy loading
Error : object 'integer64' is not exported by 'namespace:bit64'
ERROR: lazy loading failed for package 'vroom'

* removing 'D:/Program Files (x86)/R/R-3.5.3/library/vroom'
In R CMD INSTALL
Warning in install.packages :
  installation of package ‘vroom’ had non-zero exit status
ERROR: dependency 'vroom' is not available for package 'readr'
* removing 'D:/Program Files (x86)/R/R-3.5.3/library/readr'
In R CMD INSTALL
Warning in install.packages :
  installation of package ‘readr’ had non-zero exit status
ERROR: dependency 'readr' is not available for package 'haven'
* removing 'D:/Program Files (x86)/R/R-3.5.3/library/haven'
In R CMD INSTALL
Warning in install.packages :
  installation of package ‘haven’ had non-zero exit status

从上述报错中,提取关键报错信息:

Error : object 'integer64' is not exported by 'namespace:bit64'
ERROR: lazy loading failed for package 'vroom'

可以看出是vroom这一软件包出的问题。
于是,开始安装vroom软件包,参考我上一篇文章vroom包的安装。依据方法,顺利安装vroom包后,接着,直接安装tidyverse包:

install.packages("tidyverse")

安装成功!
运行tidyverse:

library(tidyverse)

显示如下内容:

-- Attaching packages -------------------------------------------------------------------------- tidyverse 1.3.2 --
v ggplot2 3.3.5     v purrr   0.3.4
v tibble  3.1.8     v dplyr   1.0.9
v tidyr   1.2.0     v stringr 1.4.1
v readr   2.1.2     v forcats 0.5.2
-- Conflicts ----------------------------------------------------------------------------- tidyverse_conflicts() --
x dplyr::filter() masks stats::filter()
x dplyr::lag()    masks stats::lag()

可以使用了!
以上是安装tidyverse时发生的小故事。

 类似资料: