美文网首页R相关知识
R 报错:ERROR: failed to lock direc

R 报错:ERROR: failed to lock direc

作者: 11的雾 | 来源:发表于2019-12-11 09:00 被阅读0次

    Error: install.packages failed to lock directory

    在使用bioconductor安装一些包的时候,比如我安装GEOquery时,会有
    Error in unpackPkgZip(foundpkgs[okp, 2L], foundpkgs[okp, 1L], lib, libs_only, :
    ERROR: failed to lock directory ‘C:\Program Files\R\R-3.6.1\library’ for modifying
    如下:

    if (!requireNamespace("BiocManager", quietly = TRUE))
        install.packages("BiocManager")
    
    BiocManager::install("GEOquery")
    
    > BiocManager::install("GEOquery")
    Bioconductor version 3.10 (BiocManager 1.30.10), R 3.6.1 (2019-07-05)
    Installing package(s) 'GEOquery'
    trying URL 'https://bioconductor.org/packages/3.10/bioc/bin/windows/contrib/3.6/GEOquery_2.54.1.zip'
    Content type 'application/zip' length 13850910 bytes (13.2 MB)
    downloaded 13.2 MB
    
    package ‘GEOquery’ successfully unpacked and MD5 sums checked
    Error in unpackPkgZip(foundpkgs[okp, 2L], foundpkgs[okp, 1L], lib, libs_only,  : 
      ERROR: failed to lock directory ‘C:\Program Files\R\R-3.6.1\library’ for modifying
    Try removing ‘C:\Program Files\R\R-3.6.1\library/00LOCK’
    
    

    解决办法:找到‘C:\Program Files\R\R-3.6.1\library/00LOCK’ 将 00LOCK文件夹删掉,重新安装就可以了

    相关文章

      网友评论

        本文标题:R 报错:ERROR: failed to lock direc

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