首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >无法安装R- bayesplot中的brms软件包时出错

无法安装R- bayesplot中的brms软件包时出错
EN

Stack Overflow用户
提问于 2022-11-23 11:47:57
回答 1查看 111关注 0票数 0

我正试图在我的Ubuntu22.04LTS计算机上安装R软件包brms。我的R版本是4.2.2,我使用的是RStudio RStudio 2022.07.2“斑点Wakerobin”。

安装了rstan,我已经成功地验证了安装。我的斯坦版本是2.21.0。

当我尝试在brms中安装RStudio时,输出如下:

代码语言:javascript
运行
复制
> install.packages("brms")
Installing package into ‘/home/iplank/R/x86_64-pc-linux-gnu-library/4.2’
(as ‘lib’ is unspecified)
also installing the dependencies ‘bayesplot’, ‘shinystan’, ‘bridgesampling’, ‘nleqslv’

trying URL 'https://cloud.r-project.org/src/contrib/bayesplot_1.10.0.tar.gz'
Content type 'application/x-gzip' length 4993447 bytes (4.8 MB)
==================================================
downloaded 4.8 MB

trying URL 'https://cloud.r-project.org/src/contrib/shinystan_2.6.0.tar.gz'
Content type 'application/x-gzip' length 2399890 bytes (2.3 MB)
==================================================
downloaded 2.3 MB

trying URL 'https://cloud.r-project.org/src/contrib/bridgesampling_1.1-2.tar.gz'
Content type 'application/x-gzip' length 1679600 bytes (1.6 MB)
==================================================
downloaded 1.6 MB

trying URL 'https://cloud.r-project.org/src/contrib/nleqslv_3.3.3.tar.gz'
Content type 'application/x-gzip' length 84686 bytes (82 KB)
==================================================
downloaded 82 KB

trying URL 'https://cloud.r-project.org/src/contrib/brms_2.18.0.tar.gz'
Content type 'application/x-gzip' length 4486548 bytes (4.3 MB)
==================================================
downloaded 4.3 MB

* installing *source* package ‘bayesplot’ ...
** package ‘bayesplot’ successfully unpacked and MD5 sums checked
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
Error in element_line(linewidth = 0.3) : 
  unused argument (linewidth = 0.3)
Error: unable to load R code in package ‘bayesplot’
Execution halted
ERROR: lazy loading failed for package ‘bayesplot’
* removing ‘/home/iplank/R/x86_64-pc-linux-gnu-library/4.2/bayesplot’
Warning in install.packages :
  installation of package ‘bayesplot’ had non-zero exit status
* installing *source* package ‘bridgesampling’ ...
** package ‘bridgesampling’ successfully unpacked and MD5 sums checked
** using staged installation
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (bridgesampling)
* installing *source* package ‘nleqslv’ ...
** package ‘nleqslv’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
gcc -I"/usr/share/R/include" -DNDEBUG   -I"/usr/lib/R/site-library/Rcpp/include/"  -I"/usr/lib/R/site-library/RcppEigen/include/"  -I"/usr/lib/R/site-library/RcppEigen/include/unsupported"  -I"/usr/lib/R/site-library/BH/include" -I"/usr/lib/R/site-library/StanHeaders/include/src/"  -I"/usr/lib/R/site-library/StanHeaders/include/"  -I"/usr/lib/R/site-library/RcppParallel/include/"  -I"/home/iplank/R/x86_64-pc-linux-gnu-library/4.2/rstan/include" -DEIGEN_NO_DEBUG  -DBOOST_DISABLE_ASSERTS  -DBOOST_PENDING_INTEGER_LOG2_HPP  -DSTAN_THREADS  -DBOOST_NO_AUTO_PTR  -include '/usr/lib/R/site-library/StanHeaders/include/stan/math/prim/mat/fun/Eigen.hpp'  -D_REENTRANT -DRCPP_PARALLEL_USE_TBB=1      -fpic  -g -O2 -ffile-prefix-map=/build/r-base-Faorqz/r-base-4.2.2.20221110=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2  -c init.c -o init.o
In file included from /usr/lib/R/site-library/RcppEigen/include/Eigen/Core:88,
                 from /usr/lib/R/site-library/RcppEigen/include/Eigen/Dense:1,
                 from /usr/lib/R/site-library/StanHeaders/include/stan/math/prim/mat/fun/Eigen.hpp:13,
                 from <command-line>:
/usr/lib/R/site-library/RcppEigen/include/Eigen/src/Core/util/Macros.h:628:1: error: unknown type name ‘namespace’
  628 | namespace Eigen {
      | ^~~~~~~~~
/usr/lib/R/site-library/RcppEigen/include/Eigen/src/Core/util/Macros.h:628:17: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
  628 | namespace Eigen {
      |                 ^
In file included from /usr/lib/R/site-library/RcppEigen/include/Eigen/Dense:1,
                 from /usr/lib/R/site-library/StanHeaders/include/stan/math/prim/mat/fun/Eigen.hpp:13,
                 from <command-line>:
/usr/lib/R/site-library/RcppEigen/include/Eigen/Core:96:10: fatal error: complex: No such file or directory
   96 | #include <complex>
      |          ^~~~~~~~~
compilation terminated.
make: *** [/usr/lib/R/etc/Makeconf:169: init.o] Error 1
ERROR: compilation failed for package ‘nleqslv’
* removing ‘/home/iplank/R/x86_64-pc-linux-gnu-library/4.2/nleqslv’
Warning in install.packages :
  installation of package ‘nleqslv’ had non-zero exit status
ERROR: dependency ‘bayesplot’ is not available for package ‘shinystan’
* removing ‘/home/iplank/R/x86_64-pc-linux-gnu-library/4.2/shinystan’
Warning in install.packages :
  installation of package ‘shinystan’ had non-zero exit status
ERROR: dependencies ‘bayesplot’, ‘shinystan’, ‘nleqslv’ are not available for package ‘brms’
* removing ‘/home/iplank/R/x86_64-pc-linux-gnu-library/4.2/brms’
Warning in install.packages :
  installation of package ‘brms’ had non-zero exit status

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

安装bayesplot时似乎有问题,但我不知道如何解决。

有人有什么建议吗?

EN

回答 1

Stack Overflow用户

发布于 2022-11-23 12:58:05

万一有人遇到同样的问题:

我安装devtools是为了能够直接从github安装bayesplot,使用:

代码语言:javascript
运行
复制
install_github("stan-dev/bayesplot", dependencies = TRUE, build_vignettes = FALSE)

这只在我安装了所有直接在R中抛出编译错误的包和而不是在RStudio中的之后才起作用。

安装bayesplot之后,我就可以安装brms了。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/74546310

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档