curl包不适用于多个R包 [英] curl package not available for several R packages

查看:67
本文介绍了curl包不适用于多个R包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚安装了ubunutu 18.04,并且成功安装了R版本3.5.1.我在安装R软件包(例如plotly)时遇到问题.似乎curl和httr包不可用.完整的错误消息:

I just installed ubunutu 18.04 and I successfully install R version 3.5.1. I am having problems installing R packages such as plotly. It seems that the packages curl and httr are not available. The full error message:

> install.packages("plotly")
Installing package into ‘/home/lualeperez/R/x86_64-pc-linux-gnu-library/3.5’
(as ‘lib’ is unspecified)
also installing the dependencies ‘curl’, ‘openssl’, ‘httr’

trying URL 'https://cloud.r-project.org/src/contrib/curl_3.2.tar.gz'
Content type 'application/x-gzip' length 367047 bytes (358 KB)
==================================================
downloaded 358 KB

trying URL 'https://cloud.r-project.org/src/contrib/openssl_1.0.2.tar.gz'
Content type 'application/x-gzip' length 1194883 bytes (1.1 MB)
==================================================
downloaded 1.1 MB

trying URL 'https://cloud.r-project.org/src/contrib/httr_1.3.1.tar.gz'
Content type 'application/x-gzip' length 147593 bytes (144 KB)
==================================================
downloaded 144 KB

trying URL 'https://cloud.r-project.org/src/contrib/plotly_4.8.0.tar.gz'
Content type 'application/x-gzip' length 1860673 bytes (1.8 MB)
==================================================
downloaded 1.8 MB

* installing *source* package ‘curl’ ...
** package ‘curl’ successfully unpacked and MD5 sums checked
Package libcurl was not found in the pkg-config search path.
Perhaps you should add the directory containing `libcurl.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libcurl' found
Package libcurl was not found in the pkg-config search path.
Perhaps you should add the directory containing `libcurl.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libcurl' found
Using PKG_CFLAGS=
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/lualeperez/R/x86_64-pc-linux-gnu-library/3.5/curl’
* installing *source* package ‘openssl’ ...
** package ‘openssl’ successfully unpacked and MD5 sums checked
Using PKG_CFLAGS=
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because openssl was not found. Try installing:
 * deb: libssl-dev (Debian, Ubuntu, etc)
 * rpm: openssl-devel (Fedora, CentOS, RHEL)
 * csw: libssl_dev (Solaris)
 * brew: openssl@1.1 (Mac OSX)
If openssl is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a openssl.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 ‘openssl’
* removing ‘/home/lualeperez/R/x86_64-pc-linux-gnu-library/3.5/openssl’
ERROR: dependencies ‘curl’, ‘openssl’ are not available for package ‘httr’
* removing ‘/home/lualeperez/R/x86_64-pc-linux-gnu-library/3.5/httr’
ERROR: dependency ‘httr’ is not available for package ‘plotly’
* removing ‘/home/lualeperez/R/x86_64-pc-linux-gnu-library/3.5/plotly’

The downloaded source packages are in
    ‘/tmp/RtmpNTZBPJ/downloaded_packages’
Warning messages:
1: In install.packages("plotly") :
  installation of package ‘curl’ had non-zero exit status
2: In install.packages("plotly") :
  installation of package ‘openssl’ had non-zero exit status
3: In install.packages("plotly") :
  installation of package ‘httr’ had non-zero exit status
4: In install.packages("plotly") :
  installation of package ‘plotly’ had non-zero exit status

我试图通过安装libcurl4来解决问题

I tried to solve the problem by installing libcurl4 by doing

sudo apt-get install libcurl4

,但是系统随后删除了所有基于r的依赖项.

but the systems then removes all the r-base dependencies.

我还没有尝试使用httr软件包解决问题.

I haven't tried to solve the problem with the httr package.

有人对如何解决此问题有任何暗示吗?

Does any one have any hint on how to solve this problem?

推荐答案

只是遇到了同样的问题,这是我发现的解决方案:

Just ran into the same issue, this is the solution I found:

由于仅安装 libcurl4-openssl-dev 会删除我所做的所有 r-base

Since just installing libcurl4-openssl-dev removes all the r-base packages what I did was

sudo apt-get install libcurl4-openssl-dev r-base

然后是

R -q -e "install.packages(c('curl'))"

它奏效了.

仅需注意的是它会升级您的R版本,但是如果您已经在使用最新的R版本,那么这不是问题.

Only caveat is that it upgrades your R version, but if you are already using the latest one then its not an issue.

这篇关于curl包不适用于多个R包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆