r - 由于 Libcurl 问题,无法安装 Tidyverse
问题描述
我最近升级到 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
推荐阅读
- google-drive-api - 在 Windows 10 上从谷歌驱动器下载大文件?
- angular - 角垫对话框未定义值 afterClosed()
- sql-server - 检查调用函数的约束在更新时不起作用
- angular - 接收数据后数据表为空
- django - 如果 url 模式不匹配,Django 如何重定向到 404 页面
- r - 将 YYYY-MM-DD 更改为三个不同的列
- angular - ng生成组件给出“意外的令牌[在位置800的json中”
- php - 如何删除缓存控制标头无缓存
- javascript - Windows 中的 HTML 颜色选择器
- python - AttributeError:“TestLogin”对象没有属性“驱动程序”