文章目录

  • 1. ggplot2包安装报错
  • 2,安装rlange1.0.0
  • 3. 安装Rtools3.6
  • 4. 重新安装ggplot2
  • 5. 安装ellipsis包
  • 6. 安装pillar包
  • 7. 重新安装ggplot2
  • 8. 测试成功安装ggplot2

现在最新的R版本是4.2.1,因为有些包只能运行在3.6版本中,因此我需要安装3.6,这里安装常用的ggplot2时报错了,总结一下问题解决的方法。

1. ggplot2包安装报错

报错如下:

** byte-compile and prepare package for lazy loading
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) : namespace 'rlang' 0.4.11 is already loaded, but >= 1.0.2 is required
Calls: <Anonymous> ... withCallingHandlers -> loadNamespace -> namespaceImport -> loadNamespace
停止执行
ERROR: lazy loading failed for package 'pillar'
* removing 'C:/Users/dave/Documents/R/win-library/3.6/pillar'
Warning in install.packages :installation of package ‘pillar’ had non-zero exit status
* installing *source* package 'scales' ...
** 成功将'scales'程序包解包并MD5和检查
** using staged installation
** R
** byte-compile and prepare package for lazy loading
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) : namespace 'rlang' 0.4.11 is being loaded, but >= 1.0.0 is required
Calls: <Anonymous> ... withCallingHandlers -> loadNamespace -> namespaceImport -> loadNamespace
停止执行
ERROR: lazy loading failed for package 'scales'
* removing 'C:/Users/dave/Documents/R/win-library/3.6/scales'
Warning in install.packages :installation of package ‘scales’ had non-zero exit status
ERROR: dependency 'scales' is not available for package 'ggplot2'
* removing 'C:/Users/dave/Documents/R/win-library/3.6/ggplot2'
Warning in install.packages :installation of package ‘ggplot2’ had non-zero exit statusThe downloaded source packages are in‘C:\Users\dave\AppData\Local\Temp\Rtmpg3apRU\downloaded_packages’

看起来,主要是因为rlange这个包版本太低,应该是大于1.0.0,现在是0.4.11.

2,安装rlange1.0.0

如果现在网上搜索R包的地址,包括其不同的版本,可以键入:
https://cran.r-project.org/src/contrib/Archive/

如果知道包的名称,比如ggplot2,键入:
https://cran.r-project.org/src/contrib/Archive/ggplot2

包的链接:
https://cran.r-project.org/src/contrib/Archive/rlang/rlang_1.0.1.tar.gz

命令:

install.packages("https://cran.r-project.org/src/contrib/Archive/rlang/rlang_1.0.1.tar.gz", repo=NULL, type="source")

报错:

* installing *source* package 'rlang' ...
** 成功将'rlang'程序包解包并MD5和检查
** using staged installation
** libs
Warning in system(cmd) : 'make' not found
ERROR: compilation failed for package 'rlang'
* removing 'C:/Users/dave/Documents/R/win-library/3.6/rlang'
* restoring previous 'C:/Users/dave/Documents/R/win-library/3.6/rlang'
Warning in install.packages :installation of package ‘C:/Users/dave/AppData/Local/Temp/Rtmpg3apRU/downloaded_packages/rlang_1.0.1.tar.gz’ had non-zero exit status

3. 安装Rtools3.6

尝试安装Rtools3.6,重启R语言,然后键入:

install.packages("https://cran.r-project.org/src/contrib/Archive/rlang/rlang_1.0.1.tar.gz", repo=NULL, type="source")

成功:

    vector-construction                     html  vector-old-ctors                        html  with_env                                html  with_handlers                           html  wref_key                                html  zap                                     html  zap_srcref                              html
*** copying figures
** building package indices
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (rlang)

测试:

> library(rlang)
> sessionInfo()
R version 3.6.3 (2020-02-29)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 22000)Matrix products: defaultlocale:
[1] LC_COLLATE=Chinese (Simplified)_China.936
[2] LC_CTYPE=Chinese (Simplified)_China.936
[3] LC_MONETARY=Chinese (Simplified)_China.936
[4] LC_NUMERIC=C
[5] LC_TIME=Chinese (Simplified)_China.936    attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     other attached packages:
[1] rlang_1.0.1loaded via a namespace (and not attached):
[1] compiler_3.6.3 cli_2.5.0      tools_3.6.3

可以看到,上面的R版本是3.6.3,rlang的版本是1.0.1,搞定。

4. 重新安装ggplot2

install.packages("ggplot2")

报错:

** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) : there is no package called 'ellipsis'
Calls: <Anonymous> ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
停止执行
ERROR: lazy loading failed for package 'ggplot2'
* removing 'C:/Users/dave/Documents/R/win-library/3.6/ggplot2'
Warning in install.packages :installation of package ‘ggplot2’ had non-zero exit status

看到,是因为没有ellipsis这个包,那就单独安装试试。

5. 安装ellipsis包

install.packages("ellipsis")

安装成功:

> install.packages("ellipsis")
Installing package into ‘C:/Users/dave/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
trying URL 'https://mirrors.tuna.tsinghua.edu.cn/CRAN/bin/windows/contrib/3.6/ellipsis_0.3.2.zip'
Content type 'application/zip' length 49192 bytes (48 KB)
downloaded 48 KBpackage ‘ellipsis’ successfully unpacked and MD5 sums checkedThe downloaded binary packages are inC:\Users\dave\AppData\Local\Temp\RtmpWqZTPD\downloaded_packages

再重新安装ggplot2:

install.packages("ggplot2")

报错:

** byte-compile and prepare package for lazy loading
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : there is no package called 'pillar'
Calls: <Anonymous> ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
停止执行
ERROR: lazy loading failed for package 'ggplot2'
* removing 'C:/Users/dave/Documents/R/win-library/3.6/ggplot2'
Warning in install.packages :installation of package ‘ggplot2’ had non-zero exit status

6. 安装pillar包

继续安装pillar,编译安装,安装成功后,继续安装ggplot2,如果哪个包报错,就安装哪个包。

7. 重新安装ggplot2

安装成功:

*** copying figures
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (ggplot2)The downloaded source packages are in‘C:\Users\dave\AppData\Local\Temp\RtmpMhrQc1\downloaded_packages’

8. 测试成功安装ggplot2

测试:

> library(ggplot2)
> sessionInfo()
R version 3.6.3 (2020-02-29)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 22000)Matrix products: defaultlocale:
[1] LC_COLLATE=Chinese (Simplified)_China.936
[2] LC_CTYPE=Chinese (Simplified)_China.936
[3] LC_MONETARY=Chinese (Simplified)_China.936
[4] LC_NUMERIC=C
[5] LC_TIME=Chinese (Simplified)_China.936    attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     other attached packages:
[1] ggplot2_3.3.6loaded via a namespace (and not attached):[1] fansi_0.4.2      withr_2.5.0      utf8_1.2.1       grid_3.6.3      [5] R6_2.5.1         lifecycle_1.0.1  gtable_0.3.0     magrittr_2.0.1  [9] scales_1.2.1     pillar_1.8.1     rlang_1.0.4      cli_2.5.0
[13] vctrs_0.3.8      ellipsis_0.3.2   tools_3.6.3      glue_1.4.2
[17] munsell_0.5.0    compiler_3.6.3   pkgconfig_2.0.3  colorspace_2.0-1
[21] tibble_3.1.1

可以看到,我的R版本是3.6.3,ggplot2的版本是3.3.6,搞定!

R语言3.6版本安装ggplot2报错解决方法相关推荐

  1. 深度学习部署:Windows安装pycocotools报错解决方法

    深度学习部署:Windows安装pycocotools报错解决方法 1.pycocotools库的简介 2.pycocotools安装的坑 3.解决办法 更多Ai资讯:公主号AiCharm 本系列是作 ...

  2. mac上安装webpack报错解决方法Hit error EACCES: permission denied, mkdir ‘/usr/local/lib/node_modules/webpack

    mac上安装webpack报错解决方法Hit error EACCES: permission denied, mkdir '/usr/local/lib/node_modules/webpack 参 ...

  3. Jenkins安装插件报错解决方法

    Jenkins安装插件报错解决方法 1.报错场景 2.场景分析 3.问题解决(不一定能全解决,看运气) 1.报错场景 按正常方式安装完Jenkins后安装插件会报错如下: // An highligh ...

  4. npm 安装依赖报错解决方法总结

    npm 安装依赖报错解决方法总结 参考文章: (1)npm 安装依赖报错解决方法总结 (2)https://www.cnblogs.com/ysxq/p/11658571.html (3)https: ...

  5. 解决虚拟机安装系统报错解决方法

    解决虚拟机安装系统报错解决方法 虚拟机安装系统报错提示: 错误原因:当你打开虚拟机安装系统时,它需要调用CPU虚拟化功能,因为他要把所有底层硬件虚拟给(VMwere 虚拟机),所以要开启虚拟化功能.虚 ...

  6. 安装APK报错解决方法

    adb install xxx.apk 报错,安装APK报错:INSTALL_FAILED_SHARED_USER_INCOMPATIBLE.INSTALL_PARSE_FAILED_INCONSIS ...

  7. 安装APK报错解决方法【转】

    本文转载自:http://blog.csdn.net/zy1235678/article/details/38122827 adb install xxx.apk 报错,安装APK报错:INSTALL ...

  8. win10家庭版无法安装mysql_win10家庭版安装SQL2000报错怎么回事|win10家庭版安装SQL2000报错解决方法...

    SQL2000是微软官方开发的最成熟的关系数据库管理系统,有网友说win10家庭版安装SQL2000总是不成功,已经重装两次系统了,而且网上删除注册表,删除安装痕迹的方法全部都用了,都不管用,怎么回事 ...

  9. R语言安装DMwR报错解决方法

    如果代码是 install.packages("DMwR") 那可能是安装包的版本问题,改为 install.packages("DMwR2") 试一下.导入的 ...

最新文章

  1. 我是SQL小菜鸟---SQL全局临时表防止用户重复登录
  2. MySQL(8)数据库中的高级(进阶)正则和存储过程
  3. java中iterator_如何在Java中读取CSV文件-Iterator和Decorator的案例研究
  4. java索引序列_视图、序列、索引
  5. Android一个Activity多个Handler时,Message消息是否会混乱?
  6. mysql-5.7.12安装
  7. 计算机毕业设计-基于springboot的社区志愿者管理系统
  8. Error opening dll library错误的解决
  9. c++计算一维数组中的最大元素
  10. 只有加法也能做深度学习,北大、华为等提出AdderNet,性能不输传统CNN
  11. androidstudio上传自己的lib到Jcenter
  12. torchaudio::is_sox_available关于使用pyinstaller 编译的问题
  13. Ubuntu 16.04 安装好之后需要做的15件事
  14. 《我的世界》游戏攻略:如何一建生成房屋指令?
  15. 没有预算的新媒体运营如何启动?
  16. LibGDX_4.1: LibGDX 游戏开发框架
  17. 【专题】详解Python中的反射机制
  18. 如何利用实验室信息管理系统LIMS轻松通过CNAS评审?
  19. 已知信码序列为1011_专升本计算机网络:校验码
  20. 安卓设置keychain_keychain(一)

热门文章

  1. java 嵌入ppt_Java 插入图片到PPT幻灯片
  2. 另一个伊甸 更新进度 23-01-27
  3. 苹果电脑python快捷键_我常用用的MAC快捷键和手势
  4. 计算机用户组怎么更改权限,win7系统用户组权限怎么设置
  5. 近期抖音刷播放量怎么刷、抖音刷播放量苹果突然走火如何防止刷量呢?
  6. 【Error】西部数据磁盘插上不显示盘符
  7. 计算机中的PS颜色填充快捷键,ps颜色填充快捷键【设置办法】
  8. 苹果天气无线网连接到服务器,苹果手机天气怎么设置?教你玩转天气应用
  9. OPERA-MS:宏基因组二、三代测序混合组装
  10. git笔记(团队协作教程,GitHub操作)