首页 > 解决方案 > 在 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")”

如果我点击进入,这将持续 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, 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:667: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:677: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:762: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:773: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:953: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:1076: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:4210: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:10714:47: 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:10758:47: 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:10786:47: 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:10797:47: 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:10863:47: 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:10898:47: 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:10908:47: 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:10916:47: 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:10947:47: 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:10957:47: 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)
           ^
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’

标签: rpackageinstall.packages

解决方案


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


推荐阅读