我正在尝试使用 install splashr,但遇到了一些依赖问题,似乎没有任何效果。我知道这与操作系统中的错误配置有关,而不是与软件包本身的问题有关,但也许你们可以提供一些指导。基本上在尝试安装 splashr 时,我得到以下日志:
> install.packages("splashr")
Installing package into ‘/home/guilherme/R/x86_64-pc-linux-gnu-library/3.4’
(as ‘lib’ is unspecified)
also installing the dependency ‘magick’
trying URL 'https://cloud.r-project.org/src/contrib/magick_2.5.0.tar.gz'
Content type 'application/x-gzip' length 4824979 bytes (4.6 MB)
==================================================
downloaded 4.6 MB
trying URL 'https://cloud.r-project.org/src/contrib/splashr_0.6.0.tar.gz'
Content type 'application/x-gzip' length 1099679 bytes (1.0 MB)
==================================================
downloaded 1.0 MB
* installing *source* package ‘magick’ ...
** package ‘magick’ successfully unpacked and MD5 sums checked
Package Magick++ was not found in the pkg-config search path.
Perhaps you should add the directory containing `Magick++.pc'
to the PKG_CONFIG_PATH environment variable
No package 'Magick++' found
Using PKG_CFLAGS=
Using PKG_LIBS=-lMagick++-6.Q16
--------------------------- [ANTICONF] --------------------------------
Configuration failed to find the Magick++ library. Try installing:
- deb: libmagick++-dev (Debian, Ubuntu)
- rpm: ImageMagick-c++-devel (Fedora, CentOS, RHEL)
- csw: imagemagick_dev (Solaris)
- brew imagemagick@6 (MacOS)
For Ubuntu versions Trusty (14.04) and Xenial (16.04) use our PPA:
sudo add-apt-repository -y ppa:cran/imagemagick
sudo apt-get update
sudo apt-get install -y libmagick++-dev
If Magick++ is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a Magick++.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
-------------------------- [ERROR MESSAGE] ---------------------------
<stdin>:1:10: fatal error: Magick++.h: No such file or directory
compilation terminated.
--------------------------------------------------------------------
ERROR: configuration failed for package ‘magick’
* removing ‘/home/guilherme/R/x86_64-pc-linux-gnu-library/3.4/magick’
Warning in install.packages :
installation of package ‘magick’ had non-zero exit status
ERROR: dependency ‘magick’ is not available for package ‘splashr’
* removing ‘/home/guilherme/R/x86_64-pc-linux-gnu-library/3.4/splashr’
Warning in install.packages :
installation of package ‘splashr’ had non-zero exit status
The downloaded source packages are in
‘/tmp/Rtmp8hJktb/downloaded_packages’
它抱怨没有找到 Magick++ 并导致它所依赖的包 magick 的另一个失败安装。输出类似:
> install.packages("magick")
Installing package into ‘/home/guilherme/R/x86_64-pc-linux-gnu-library/3.4’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/magick_2.5.0.tar.gz'
Content type 'application/x-gzip' length 4824979 bytes (4.6 MB)
==================================================
downloaded 4.6 MB
* installing *source* package ‘magick’ ...
** package ‘magick’ successfully unpacked and MD5 sums checked
Package Magick++ was not found in the pkg-config search path.
Perhaps you should add the directory containing `Magick++.pc'
to the PKG_CONFIG_PATH environment variable
No package 'Magick++' found
Using PKG_CFLAGS=
Using PKG_LIBS=-lMagick++-6.Q16
--------------------------- [ANTICONF] --------------------------------
Configuration failed to find the Magick++ library. Try installing:
- deb: libmagick++-dev (Debian, Ubuntu)
- rpm: ImageMagick-c++-devel (Fedora, CentOS, RHEL)
- csw: imagemagick_dev (Solaris)
- brew imagemagick@6 (MacOS)
For Ubuntu versions Trusty (14.04) and Xenial (16.04) use our PPA:
sudo add-apt-repository -y ppa:cran/imagemagick
sudo apt-get update
sudo apt-get install -y libmagick++-dev
If Magick++ is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a Magick++.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
-------------------------- [ERROR MESSAGE] ---------------------------
<stdin>:1:10: fatal error: Magick++.h: No such file or directory
compilation terminated.
--------------------------------------------------------------------
ERROR: configuration failed for package ‘magick’
* removing ‘/home/guilherme/R/x86_64-pc-linux-gnu-library/3.4/magick’
Warning in install.packages :
installation of package ‘magick’ had non-zero exit status
The downloaded source packages are in
‘/tmp/Rtmp8hJktb/downloaded_packages’
所以我进入终端安装缺少的包 libmagick++-dev,但它也没有走远,因为它一直在询问依赖项的依赖关系:
以下软件包具有未满足的依赖关系: libmagick++-dev :依赖:libmagick++-6.q16-dev 但不会安装
依赖树还在继续:
libmagick++-dev
libmagick++-6.q16-dev
libmagickcore-6.q16-dev
libmagickwand-6.q16-dev
librsvg2-dev
libcairo2-dev
libfontconfig1-dev
libfontconfig1
由于错误,我无法安装它们中的任何一个:“......但它不会被安装”
我已经尝试多次卸载/安装 imagemagick 无济于事。
这些是有关环境变量的一些信息。
$PATH:
/home/guilherme/.local/share/umake/bin:/home/guilherme/bin:/home/guilherme/.local/share/umake/bin:/home/guilherme/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin:/home/guilherme/.config/composer/vendor/bin:bin/msys-ssh-1000-18:/usr/lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin:/home/guilherme/.fzf/bin:/home/guilherme/.config/composer/vendor/bin
$PKG_CONFIG_PATH:(空)
lsb_release -a:
Distributor ID: Ubuntu
Description: Ubuntu 18.04.5 LTS
Release: 18.04
Codename: bionic
我完全迷路了。谁能帮我这个?
编辑:
根据 N0rbert 的建议,这是输出apt-cache policy libmagick++-6.q16-dev
:
libmagick++-6.q16-dev:
Installed: (none)
Candidate: 8:6.9.7.4+dfsg-16ubuntu6.8
Version table:
8:6.9.7.4+dfsg-16ubuntu6.8 500
500 http://us.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages
500 http://us.archive.ubuntu.com/ubuntu bionic-security/main amd64 Packages
500 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages
8:6.9.7.4+dfsg-16ubuntu6 500
500 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 Packages