代码之家  ›  专栏  ›  技术社区  ›  amahido

无法安装三明治软件包:软件包三明治的安装具有非零退出状态

  •  0
  • amahido  · 技术社区  · 7 年前

    我需要安装“plm”软件包。安装后,“三明治”包不见了。

    > library(plm)
    Error: package or namespace load failed for ‘plm’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
     there is no package called ‘sandwich
    

    试图安装“三明治”软件包,返回此文件:

    Installing package into ‘library_path’
    (as ‘lib’ is unspecified)
    also installing the dependency ‘zoo’
    
    There is a binary version available but the source version is later:
             binary source needs_compilation
    sandwich  2.3-4  2.4-0             FALSE
    
    trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/zoo_1.8-0.zip'
    Content type 'application/zip' length 901864 bytes (880 KB)
    downloaded 880 KB
    
    package ‘zoo’ successfully unpacked and MD5 sums checked
    
    The downloaded binary packages are in
        C:\directory\downloaded_packages
    installing the source package ‘sandwich’
    
    trying URL 'https://cran.rstudio.com/src/contrib/sandwich_2.4-0.tar.gz'
    Content type 'application/x-gzip' length 1280592 bytes (1.2 MB)
    downloaded 1.2 MB
    
    '\\directory\My Documents'
    CMD.EXE was started with the above path as the current directory.
    UNC paths are not supported.  Defaulting to Windows directory.
    * installing *source* package 'sandwich' ...
    ** package 'sandwich' successfully unpacked and MD5 sums checked
    ** R
    ** data
    ** inst
    ** preparing package for lazy loading
    ** help
    *** installing help indices
    ** building package indices
    ** installing vignettes
    Warning in file(con, "w") :
      cannot open file '\\library_path/sandwich/doc/index.html': No such file or directory
    Error in file(con, "w") : cannot open the connection
    ERROR: installing vignettes failed
    * removing '\\library_path/sandwich'
    Warning in install.packages :
      running command '"C:/R-34~1.1/bin/x64/R" CMD INSTALL -l "\\library_path" C:\directory/downloaded_packages/sandwich_2.4-0.tar.gz' had status 1
    Warning in install.packages :
      installation of package ‘sandwich’ had non-zero exit status
    
    The downloaded source packages are in
        ‘C:\directory\downloaded_packages’
    

    已尝试:

    1. 将R和RStudio直接重新安装到C(不在C:\程序文件中)
    2. 使用此命令安装所有依赖项:

      install.packages("sandwich", dependencies=TRUE)

    1 回复  |  直到 7 年前
        1
  •  0
  •   amahido    7 年前

    我想我找到了解决我问题的临时答案。我以前在R中写入库文件夹时遇到了与权限相关的问题。我试图通过关闭杀毒实时更新、更改R文件夹的安全性等方式来解决问题。我认为这是可行的,因为我没有发现关于“无法移动临时安装…”的问题。但是当我重新启动电脑时,问题再次出现。

    由于我在大学提供的笔记本电脑中工作,我需要等到它允许我作为管理员访问。在等待它的过程中,我用C:/(在我的例子中,我将其命名为“R library local”)创建了一个新库。已将所有软件包下载到该库

    并从库中加载包

    库(“plm”,lib=“C:/R库本地”)