gpt4 book ai didi

r - 安装包 ‘rjags’ 的退出状态非零

转载 作者:行者123 更新时间:2023-12-04 12:01:45 25 4
gpt4 key购买 nike

S.O.:Linux Ubuntu 14.04 LTS
R: R version 3.2.1 (2015-06-18) -- 《世界著名宇航员》
版权所有 (C) 2015 统计计算 R 基金会
平台:i686-pc-linux-gnu(32 位)

当我尝试安装软件包时 rjags ,我收到以下 fatal error :

install.packages("rjags")
Installing package into ‘/home/marco/.rkward/library’
(as ‘lib’ is unspecified)
--- Please select a CRAN mirror for use in this session ---
trying URL 'http://mirrors.softliste.de/cran/src/contrib/rjags_3-15.tar.gz'
Content type 'application/x-gzip' length 66879 bytes (65 KB)
==================================================
downloaded 65 KB

* installing *source* package ‘rjags’ ...
** package ‘rjags’ successfully unpacked and MD5 sums checked
checking for prefix by checking for jags... no
configure: error: "Location of JAGS headers not defined. Use configure arg '--with-jags-include' or environment variable 'JAGS_INCLUDE'"
ERROR: configuration failed for package ‘rjags’
* removing ‘/home/marco/.rkward/library/rjags’

The downloaded source packages are in
‘/tmp/RtmpditLat/downloaded_packages’
Warning message:
In install.packages("rjags") :
installation of package ‘rjags’ had non-zero exit status

显然,第一条错误信息是

configure: error: "Location of JAGS headers not defined. Use configure arg '--with-jags-include' or environment variable 'JAGS_INCLUDE'"



我该如何解决这个问题?

最佳答案

正如顶级评论所解释的那样,您需要在系统中安装 JAGS(Just Another Gibbs Sampler)。由于您使用的是 Ubuntu 14.04,因此运行

sudo apt-get install jags

应该够了。但是,如果您在另一个发行版中(或者,由于某种原因,上面的代码对您不起作用),最好知道如何从源获取 JAGS:
  • 访问 http://mcmc-jags.sourceforge.net/
  • 在“下载”下查找正确的版本。例如,Fedora 用户应该查看 http://download.opensuse.org/repositories/home:/cornell_vrdc/ 的 Fedora_20 文件夹。
  • 不要忘记下载基础版和开发版。

  • 安装成功后,您可以返回 R(无论如何在整个过程中都可以保持打开状态)并安装您想要的包。

    关于r - 安装包 ‘rjags’ 的退出状态非零,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32307249/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com