【问题标题】:Unable to install package RGLPK with R Studio Server in AWS无法在 AWS 中使用 R Studio Server 安装包 RGLPK
【发布时间】:2020-11-19 22:27:16
【问题描述】:

我正在尝试使用运行 R Studio 1.3 和 R 4.0 的 AWS EC2 实例安装包 RGLPK。我得到了这个结果:

> install.packages("Rglpk")
Installing package into ‘/home/rstudio/R/x86_64-pc-linux-gnu-library/4.0’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/src/contrib/Rglpk_0.6-4.tar.gz'
Content type 'application/x-gzip' length 21753 bytes (21 KB)
==================================================
downloaded 21 KB

* installing *source* package ‘Rglpk’ ...
** package ‘Rglpk’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
/bin/bash: line 0: cd: GLPK: No such file or directory
Makevars:10: recipe for target 'GLPK.ts' failed
make: *** [GLPK.ts] Error 1
ERROR: compilation failed for package ‘Rglpk’
* removing ‘/home/rstudio/R/x86_64-pc-linux-gnu-library/4.0/Rglpk’
Warning in install.packages :
  installation of package ‘Rglpk’ had non-zero exit status

The downloaded source packages are in
    ‘/tmp/RtmpHmQk09/downloaded_packages’

我发现了许多涉及此软件包的类似错误。比如这样: GLPK: No such file or directory error when trying to install R package

似乎有 3 或 4 个解决方案,但它们涉及来自终端窗口的 sudo 命令。我在虚拟机中。

【问题讨论】:

    标签: r amazon-web-services amazon-ec2 installation install.packages


    【解决方案1】:

    这行得通:

    在 R Studio Server 的终端中:

    sudo apt install libglpk-dev
    

    然后回到控制台,安装 R 库:

    install.packages("Rglpk")
    

    信用:来自这篇文章的@AdamErickson: GLPK: No such file or directory error when trying to install R package

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-07-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-08-19
      • 2018-04-22
      • 1970-01-01
      相关资源
      最近更新 更多