首页 > 解决方案 > 无法在 R 3.6.1 下使用 conda 环境安装 bibliometrix

问题描述

我想在 R 3.6.1 下安装 bibliometrix 包但失败了。我的 Mac 的 C++ 编译器似乎与包要求不对应。

install.packages("bibliometrix")
also installing the dependencies ‘polyclip’, ‘ggforce’, ‘ggraph’

试开URL’https://cran.rstudio.com/src/contrib/polyclip_1.10-0.tar.gz'
Content type 'application/x-gzip' length 79619 bytes (77 KB)
==================================================
downloaded 77 KB

试开URL’https://cran.rstudio.com/src/contrib/ggforce_0.3.0.tar.gz'
Content type 'application/x-gzip' length 857393 bytes (837 KB)
==================================================
downloaded 837 KB

试开URL’https://cran.rstudio.com/src/contrib/ggraph_1.0.2.tar.gz'
Content type 'application/x-gzip' length 2607278 bytes (2.5 MB)
==================================================
downloaded 2.5 MB

试开URL’https://cran.rstudio.com/src/contrib/bibliometrix_2.2.1.tar.gz'
Content type 'application/x-gzip' length 4649396 bytes (4.4 MB)
==================================================
downloaded 4.4 MB

* installing *source* package ‘polyclip’ ...
** 成功将‘polyclip’程序包解包并MD5和检查
** using staged installation
compiling under C++11
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... configure: error: in `/private/var/folders/99/lxnbdsys4_95hcvfp98rkjr80000gp/T/RtmpPPQJJS/R.INSTALL694939cbda46/polyclip':
configure: error: cannot run C++ compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details
ERROR: configuration failed for package ‘polyclip’
* removing ‘/Users/Excited_Lee/miniconda3/lib/R/library/polyclip’
Warning in install.packages :
  installation of package ‘polyclip’ had non-zero exit status
ERROR: dependency ‘polyclip’ is not available for package ‘ggforce’
* removing ‘/Users/Excited_Lee/miniconda3/lib/R/library/ggforce’
Warning in install.packages :
  installation of package ‘ggforce’ had non-zero exit status
ERROR: dependency ‘ggforce’ is not available for package ‘ggraph’
* removing ‘/Users/Excited_Lee/miniconda3/lib/R/library/ggraph’
Warning in install.packages :
  installation of package ‘ggraph’ had non-zero exit status
ERROR: dependency ‘ggraph’ is not available for package ‘bibliometrix’
* removing ‘/Users/Excited_Lee/miniconda3/lib/R/library/bibliometrix’
Warning in install.packages :
  installation of package ‘bibliometrix’ had non-zero exit status

The downloaded source packages are in
    ‘/private/var/folders/99/lxnbdsys4_95hcvfp98rkjr80000gp/T/RtmpZkQMzg/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done

我在 Jupyter 和 Rstudio 下尝试过,但出现了同样的错误。我的系统信息如下所示:

(base) usddeiMac:~ Excited_Lee$ conda -V
conda 4.7.11
(base) usddeiMac:~ Excited_Lee$ r --version
R version 3.6.1 (2019-07-05) -- "Action of the Toes"
Copyright (C) 2019 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin13.4.0 (64-bit)

标签: rcondainstall.packages

解决方案


推荐阅读