【发布时间】:2019-03-20 11:02:50
【问题描述】:
我最近升级到 R 3.5 并且无法安装“tidyverse”包。其他软件包安装正常。每当我尝试安装 tidyverse 时,都会收到以下错误消息。
* installing *source* package ‘curl’ ...
** package ‘curl’ successfully unpacked and MD5 sums checked
Found pkg-config cflags and libs!
Using PKG_CFLAGS=-I/usr/include/x86_64-linux-gnu
Using PKG_LIBS=-lcurl
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because libcurl was not found. Try installing:
* deb: libcurl4-openssl-dev (Debian, Ubuntu, etc)
* rpm: libcurl-devel (Fedora, CentOS, RHEL)
* csw: libcurl_dev (Solaris)
If libcurl is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a libcurl.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: configuration failed for package ‘curl’
* removing ‘/home/nik/anaconda3/lib/R/library/curl’
ERROR: dependency ‘curl’ is not available for package ‘httr’
* removing ‘/home/nik/anaconda3/lib/R/library/httr’
ERROR: dependency ‘httr’ is not available for package ‘rvest’
* removing ‘/home/nik/anaconda3/lib/R/library/rvest’
ERROR: dependencies ‘httr’, ‘rvest’ are not available for package ‘tidyverse’
* removing ‘/home/nik/anaconda3/lib/R/library/tidyverse’
The downloaded source packages are in
‘/tmp/RtmpHJ48Sk/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning messages:
1: In install.packages("tidyverse") :
installation of package ‘curl’ had non-zero exit status
2: In install.packages("tidyverse") :
installation of package ‘httr’ had non-zero exit status
3: In install.packages("tidyverse") :
installation of package ‘rvest’ had non-zero exit status
4: In install.packages("tidyverse") :
installation of package ‘tidyverse’ had non-zero exit status
我已经运行了sudo apt-get install libcurl4-openssl-dev,正如其他线程针对相同问题所建议的那样。但是,这似乎并不能解决问题(实际上,libcurl 已经安装,重新安装也不起作用)。
当我检查 $PATH 时,我没有看到“pkg-config”,而且 PKG_CONFIG_PATH 似乎不存在。将/usr/bin/pkg-config 添加到路径并设置PKG_CONFIG_PATH /home/nik/anaconda3/lib/pkgconfig/libcurl.pc 似乎也没有解决问题。在这一点上,我束手无策,因为我想不出还有什么要卸载/重新安装的,也想不出为什么在我安装 libcurl 时没有将它自己添加到路径中。任何帮助都将不胜感激。
【问题讨论】:
-
我没有遇到过这个问题,但我遇到过类似的问题,还有其他依赖项。根据错误消息,您可能想尝试将路径设置为包含 libcurl 而不是 libcurl 本身的目录,即
PKG_CONFIG_PATH=/home/nik/anaconda3/lib/pkgconfig -
在尝试了越来越愚蠢的事情两天后,立即解决了问题。谢谢!
-
没问题。既然这样有效,我就继续添加它作为答案。