微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

在R中安装dagitty和ggdag软件包时出错

如何解决在R中安装dagitty和ggdag软件包时出错

当我尝试安装以下软件包时:

install.packages("dagitty")
install.packages("ggdag")

我在控制台中收到以下消息:

> install.packages("dagitty")
also installing the dependency ‘V8’


  There are binary versions available but the source versions
  are later:
        binary source needs_compilation
V8       3.0.2  3.2.0              TRUE
dagitty  0.2-2  0.3-0             FALSE

Do you want to install from sources the package which needs compilation? (Yes/no/cancel) install.packages("ggdag")
Error in install.packages : Unrecognized response “install.packages("ggdag")”

如果单击Enter,此操作将持续5分钟左右,最后,我再次收到错误消息。你知道会发生什么吗?

编辑: 如果在“是否要从源安装需要编译的软件包?(是/否/取消)”问题后运行“是”,则在控制台中会收到以下错误消息:

> install.packages("dagitty")
also installing the dependency ‘V8’


  There are binary versions available but the source versions
  are later:
        binary source needs_compilation
V8       3.0.2  3.2.0              TRUE
dagitty  0.2-2  0.3-0             FALSE

Do you want to install from sources the package which needs compilation? (Yes/no/cancel) Yes
installing the source packages ‘V8’,‘dagitty’

trying URL 'https://cran.rstudio.com/src/contrib/V8_3.2.0.tar.gz'
Content type 'application/x-gzip' length 680510 bytes (664 KB)
==================================================
downloaded 664 KB

trying URL 'https://cran.rstudio.com/src/contrib/dagitty_0.3-0.tar.gz'
Content type 'application/x-gzip' length 109421 bytes (106 KB)
==================================================
downloaded 106 KB

* installing *source* package ‘V8’ ...
** package ‘V8’ successfully unpacked and MD5 sums checked
Wed Sep 16 13:48:22 WEST 2020: Auto-brewing v8 in /private/var/folders/7x/yhkdjwwd08l7zdxy1m4gsw2h0000gn/T/RtmphG4Eoz/R.INSTALL48bc16566677/.autobrew/build-v8...
==> Tapping autobrew/core from https://github.com/autobrew/homebrew-core
Tapped 2 commands and 4639 formulae (4,887 files,12.7MB).
==> Downloading https://autobrew.github.io/bottles/v8-8.3.110.9.high_sierra.bottle.tar.gz
==> Pouring v8-8.3.110.9.high_sierra.bottle.tar.gz
==> Skipping post_install step for autobrew...
?  /private/var/folders/7x/yhkdjwwd08l7zdxy1m4gsw2h0000gn/T/RtmphG4Eoz/R.INSTALL48bc16566677/.autobrew/build-v8/Cellar/v8/8.3.110.9: 52 files,59.3MB
Using PKG_CFLAGS=-I/private/var/folders/7x/yhkdjwwd08l7zdxy1m4gsw2h0000gn/T/RtmphG4Eoz/R.INSTALL48bc16566677/.autobrew/build-v8/opt/v8/include -I/private/var/folders/7x/yhkdjwwd08l7zdxy1m4gsw2h0000gn/T/RtmphG4Eoz/R.INSTALL48bc16566677/.autobrew/build-v8/opt/v8/libexec/include
Using PKG_LIBS=-L/private/var/folders/7x/yhkdjwwd08l7zdxy1m4gsw2h0000gn/T/RtmphG4Eoz/R.INSTALL48bc16566677/.autobrew/build-v8/opt/v8/libexec -lv8_base_without_compiler -lv8_compiler -lv8_libplatform -lv8_snapshot -lv8_libbase -lv8_libsampler -lv8_initializers -lv8_init -ltorque_base -ltorque_generated_deFinitions -ltorque_generated_initializers -lchrome_zlib -lcompression_utils_portable
-----------------------------[ ANTICONF ]-------------------------------
Configuration Failed to find the libv8 engine library. Try installing:
 * deb: libv8-dev or libnode-dev (Debian / Ubuntu)
 * rpm: v8-devel (Fedora,EPEL)
 * brew: v8 (OSX)
 * csw: libv8_dev (Solaris)
To use a custom libv8,set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
---------------------------[ ERROR MESSAGE ]----------------------------
In file included from <stdin>:1:
/private/var/folders/7x/yhkdjwwd08l7zdxy1m4gsw2h0000gn/T/RtmphG4Eoz/R.INSTALL48bc16566677/.autobrew/build-v8/opt/v8/libexec/include/v8.h:197:49: error: too many arguments provided to function-like macro invocation
    static_assert(std::is_base_of<T,S>::value,"type check");
                                                ^
/Library/Developer/CommandLinetools/usr/include/c++/v1/__config:805:12: note: macro 'static_assert' defined here
#   define static_assert(__b,__m) _Static_assert(__b,__m)
           ^
In file included from <stdin>:1:
/private/var/folders/7x/yhkdjwwd08l7zdxy1m4gsw2h0000gn/T/RtmphG4Eoz/R.INSTALL48bc16566677/.autobrew/build-v8/opt/v8/libexec/include/v8.h:363:49: error: too many arguments provided to function-like macro invocation
    static_assert(std::is_base_of<T,__m)
           ^
In file included from <stdin>:1:
/private/var/folders/7x/yhkdjwwd08l7zdxy1m4gsw2h0000gn/T/RtmphG4Eoz/R.INSTALL48bc16566677/.autobrew/build-v8/opt/v8/libexec/include/v8.h:667:49: error: too many arguments provided to function-like macro invocation
    static_assert(std::is_base_of<T,__m)
           ^
In file included from <stdin>:1:
/private/var/folders/7x/yhkdjwwd08l7zdxy1m4gsw2h0000gn/T/RtmphG4Eoz/R.INSTALL48bc16566677/.autobrew/build-v8/opt/v8/libexec/include/v8.h:677:49: error: too many arguments provided to function-like macro invocation
    static_assert(std::is_base_of<T,__m)
           ^
In file included from <stdin>:1:
/private/var/folders/7x/yhkdjwwd08l7zdxy1m4gsw2h0000gn/T/RtmphG4Eoz/R.INSTALL48bc16566677/.autobrew/build-v8/opt/v8/libexec/include/v8.h:762:49: error: too many arguments provided to function-like macro invocation
    static_assert(std::is_base_of<T,__m)
           ^
In file included from <stdin>:1:
/private/var/folders/7x/yhkdjwwd08l7zdxy1m4gsw2h0000gn/T/RtmphG4Eoz/R.INSTALL48bc16566677/.autobrew/build-v8/opt/v8/libexec/include/v8.h:773:49: error: too many arguments provided to function-like macro invocation
    static_assert(std::is_base_of<T,__m)
           ^
In file included from <stdin>:1:
/private/var/folders/7x/yhkdjwwd08l7zdxy1m4gsw2h0000gn/T/RtmphG4Eoz/R.INSTALL48bc16566677/.autobrew/build-v8/opt/v8/libexec/include/v8.h:953:49: error: too many arguments provided to function-like macro invocation
    static_assert(std::is_base_of<T,__m)
           ^
In file included from <stdin>:1:
/private/var/folders/7x/yhkdjwwd08l7zdxy1m4gsw2h0000gn/T/RtmphG4Eoz/R.INSTALL48bc16566677/.autobrew/build-v8/opt/v8/libexec/include/v8.h:1076:49: error: too many arguments provided to function-like macro invocation
    static_assert(std::is_base_of<T,__m)
           ^
In file included from <stdin>:1:
/private/var/folders/7x/yhkdjwwd08l7zdxy1m4gsw2h0000gn/T/RtmphG4Eoz/R.INSTALL48bc16566677/.autobrew/build-v8/opt/v8/libexec/include/v8.h:4210:49: error: too many arguments provided to function-like macro invocation
    static_assert(std::is_base_of<T,__m)
           ^
In file included from <stdin>:1:
/private/var/folders/7x/yhkdjwwd08l7zdxy1m4gsw2h0000gn/T/RtmphG4Eoz/R.INSTALL48bc16566677/.autobrew/build-v8/opt/v8/libexec/include/v8.h:10714:47: error: too many arguments provided to function-like macro invocation
  static_assert(std::is_base_of<T,"type check");
                                              ^
/Library/Developer/CommandLinetools/usr/include/c++/v1/__config:805:12: note: macro 'static_assert' defined here
#   define static_assert(__b,__m)
           ^
In file included from <stdin>:1:
/private/var/folders/7x/yhkdjwwd08l7zdxy1m4gsw2h0000gn/T/RtmphG4Eoz/R.INSTALL48bc16566677/.autobrew/build-v8/opt/v8/libexec/include/v8.h:10758:47: error: too many arguments provided to function-like macro invocation
  static_assert(std::is_base_of<T,__m)
           ^
In file included from <stdin>:1:
/private/var/folders/7x/yhkdjwwd08l7zdxy1m4gsw2h0000gn/T/RtmphG4Eoz/R.INSTALL48bc16566677/.autobrew/build-v8/opt/v8/libexec/include/v8.h:10786:47: error: too many arguments provided to function-like macro invocation
  static_assert(std::is_base_of<T,__m)
           ^
In file included from <stdin>:1:
/private/var/folders/7x/yhkdjwwd08l7zdxy1m4gsw2h0000gn/T/RtmphG4Eoz/R.INSTALL48bc16566677/.autobrew/build-v8/opt/v8/libexec/include/v8.h:10797:47: error: too many arguments provided to function-like macro invocation
  static_assert(std::is_base_of<T,__m)
           ^
In file included from <stdin>:1:
/private/var/folders/7x/yhkdjwwd08l7zdxy1m4gsw2h0000gn/T/RtmphG4Eoz/R.INSTALL48bc16566677/.autobrew/build-v8/opt/v8/libexec/include/v8.h:10863:47: error: too many arguments provided to function-like macro invocation
  static_assert(std::is_base_of<T,__m)
           ^
In file included from <stdin>:1:
/private/var/folders/7x/yhkdjwwd08l7zdxy1m4gsw2h0000gn/T/RtmphG4Eoz/R.INSTALL48bc16566677/.autobrew/build-v8/opt/v8/libexec/include/v8.h:10898:47: error: too many arguments provided to function-like macro invocation
  static_assert(std::is_base_of<T,__m)
           ^
In file included from <stdin>:1:
/private/var/folders/7x/yhkdjwwd08l7zdxy1m4gsw2h0000gn/T/RtmphG4Eoz/R.INSTALL48bc16566677/.autobrew/build-v8/opt/v8/libexec/include/v8.h:10908:47: error: too many arguments provided to function-like macro invocation
  static_assert(std::is_base_of<T,__m)
           ^
In file included from <stdin>:1:
/private/var/folders/7x/yhkdjwwd08l7zdxy1m4gsw2h0000gn/T/RtmphG4Eoz/R.INSTALL48bc16566677/.autobrew/build-v8/opt/v8/libexec/include/v8.h:10916:47: error: too many arguments provided to function-like macro invocation
  static_assert(std::is_base_of<T,__m)
           ^
In file included from <stdin>:1:
/private/var/folders/7x/yhkdjwwd08l7zdxy1m4gsw2h0000gn/T/RtmphG4Eoz/R.INSTALL48bc16566677/.autobrew/build-v8/opt/v8/libexec/include/v8.h:10947:47: error: too many arguments provided to function-like macro invocation
  static_assert(std::is_base_of<T,__m)
           ^
In file included from <stdin>:1:
/private/var/folders/7x/yhkdjwwd08l7zdxy1m4gsw2h0000gn/T/RtmphG4Eoz/R.INSTALL48bc16566677/.autobrew/build-v8/opt/v8/libexec/include/v8.h:10957:47: error: too many arguments provided to function-like macro invocation
  static_assert(std::is_base_of<T,__m)
           ^
Fatal error: too many errors emitted,stopping Now [-ferror-limit=]
20 errors generated.
------------------------------------------------------------------------
ERROR: configuration Failed for package ‘V8’
* removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/V8’
Warning in install.packages :
  installation of package ‘V8’ had non-zero exit status
ERROR: dependency ‘V8’ is not available for package ‘dagitty’
* removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/dagitty’
Warning in install.packages :
  installation of package ‘dagitty’ had non-zero exit status

The downloaded source packages are in
    ‘/private/var/folders/7x/yhkdjwwd08l7zdxy1m4gsw2h0000gn/T/Rtmpf4b2AB/downloaded_packages’

解决方法

您可能必须先安装 V8。由于我假设您使用 OSX,因此您可以通过自制软件安装它:brew install v8 应该可以解决问题

,

您是否尝试同时安装两个软件包?第一行install.packages("dagitty")试图求值,但是它需要对二进制文件的处理方式进行手动响应。当出现该提示时,R尝试适合您提交的第二行。该行不是提示的有效答案。一次安装一个,看看是否可行。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。