簡體   English   中英

curl package 不適用於多個 R 包

[英]curl package not available for several R packages

我剛剛安裝了ubunutu 18.04,我成功安裝了R版本3.5.1。 我在安裝 R 包時遇到問題,例如 plotly。似乎包 curl 和 httr 不可用。 完整的錯誤信息:

> 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 來解決問題

sudo apt-get install libcurl4

但是系統隨后刪除了所有 r-base 依賴項。

我還沒有嘗試用 httr package 解決問題。

有沒有人對如何解決這個問題有任何暗示?

您正在嘗試從源代碼編譯。 這有時會產生所謂的構建依賴關系 您錯過了它們,並且您正在忽略(稍微清楚的)錯誤消息,因為您正在被多個安裝所淹沒。

所以第一個提示,所以一次一個包。

第二個提示:意識到Ubuntu中有很多(如果不是全部)可用。 所以就這么做

sudo apt install r-cran-curl

安裝例如卷曲。 與其他人一樣。

第三條提示:在邁克爾的PPA上,Ubuntu有超過3000個CRAN包。 閱讀本自述文件的頂部然后轉到此PPA (如果您想要3.5,請執行此操作)。

剛遇到同樣的問題,這是我找到的解決方案:

由於只是安裝libcurl4-openssl-dev會刪除我所做的所有r-base軟件包

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

然后

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

它起作用了。

唯一需要注意的是它會升級您的R版本,但如果您已經使用了最新版本,則不是問題。

軟呢帽 36:

dnf install cmake
dnf install openssl-devel
dnf install libcurl-devel.x86_64

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM