我正在尝试使用 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
所需的文件
Magick++.pc
文件包含在libmagick++-6.q16-dev中,可从仿生更新和/或仿生安全口袋中获得。因此,您必须首先通过运行软件和更新 (software-properties-gtk
) 或/etc/apt/sources.list
手动编辑来检查您的存储库。然后在全新完全更新的 18.04 LTS 系统上执行以下命令将导致编译成功:
最后在
R
会话中:应该成功结束。
在这个问题中,我在magick repo的维护者的帮助下想通了。底线,主要问题是我有版本 2.3 但请求的版本是 2:
libfontconfig1
按照Jeroen的建议,我只是强制安装第 2 版:
之后,从底部安装的每个依赖项都没有问题。
我能够在终端中使用以下命令在 Ubuntu 上安装 magick 包:
sudo add-apt-repository -y ppa:cran/imagemagick
sudo apt-get update
sudo apt-get install -y libmagick++-dev