美文网首页
一次解决安装包的问题

一次解决安装包的问题

作者: 见龙在田007er2770 | 来源:发表于2020-04-28 10:58 被阅读0次

    内容提要:

    ### 解决方案:
    1. dependencies = TRUE.
    2. run as administrator.
    3. update R and R related tools(eg: Rtools).
    4. unload attached packages in initial start.
    5. remove prior packages and reinstall it.
    6. just try it again.
    7. ……
    

    problem

    install.packages(packagedir , repos=NULL)
    
    Hi, Dr., Welcome at Mon Jul 06 09:54:11 2020 
    ERROR: failed to lock directory 'D:/tools/R/R_Library' for modifying
    Try removing 'D:/tools/R/R_Library/00LOCK-backports'
    Warning in install.packages :
      installation of package ‘C:/Users/D./Downloads/Compressed/backports_1.1.8.tar.gz’ had non-zero exit status
    

    solving

    delete the director "00LOCK" 
    

    result

    > packagedir <- choose.files()
    > install.packages(packagedir , repos=NULL)
    * installing *source* package 'backports' ...
    ** package 'backports' successfully unpacked and MD5 sums checked
    ** using staged installation
    ** libs
    

    problem

      installation of package ‘tibble’ had non-zero exit status
    

    solving

    1. install.packages("tibble", dependencies = TRUE)
    2. devtools::install_github("tidyverse/tibble")

    result 1

    Warning in install.packages :
      installation of package ‘tibble’ had non-zero exit status
    

    resolving 1

    1. run as administration
    2. install.packages("tibble", dependencies = TRUE)

    result 2

    Warning in install.packages :
      installation of package ‘tibble’ had non-zero exit status
    

    resolving 2

    1. run as administration
    2. devtools::install_github("tidyverse/tibble")

    result 2

    no warning
    

    solved !

    another example

    I had the exact same issue just today. Running Rstudio with administrator rights did not solve the issue.
    
    With me the problem was that my Rprofile loaded "usethis", "devtools", and "testthat" on startup. One or more of these packages loads "rlang", and this prevented "rlang" from being updated.
    
    I solved it like this:
    
    file.edit(file.path("~", ".Rprofile"))
    
    Comment out all the loaded packages.
    Restart session
    install.packages("rlang")
    
    I hope this helps.
    

    相关文章

      网友评论

          本文标题:一次解决安装包的问题

          本文链接:https://www.haomeiwen.com/subject/ivxvwhtx.html