在raspberry pilinux上安装r包('rvest'):为什么我的配置失败?

问题描述 投票:0回答:1

我试图在raspberry pi上运行我的web scraper,但一直失败。我从来没有使用过Linux,所以我的问题可能很基本。

当我打开R并输入install.packages('rvest')时,它总是给我同样的错误。

我到底做错了什么?

    install.packages('rvest')
Installing package into ‘/home/pi/R/arm-unknown-linux-gnueabihf-library/3.5’
(as ‘lib’ is unspecified)
also installing the dependencies ‘curl’, ‘openssl’, ‘xml2’, ‘httr’

trying URL 'https://cloud.r-project.org/src/contrib/curl_4.3.tar.gz'
Content type 'application/x-gzip' length 673779 bytes (657 KB)
==================================================
downloaded 657 KB

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

trying URL 'https://cloud.r-project.org/src/contrib/xml2_1.3.2.tar.gz'
Content type 'application/x-gzip' length 271876 bytes (265 KB)
==================================================
downloaded 265 KB

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

trying URL 'https://cloud.r-project.org/src/contrib/rvest_0.3.5.tar.gz'
Content type 'application/x-gzip' length 1129355 bytes (1.1 MB)
==================================================
downloaded 1.1 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/pi/R/arm-unknown-linux-gnueabihf-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: [email protected] (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/pi/R/arm-unknown-linux-gnueabihf-library/3.5/openssl’
* installing *source* package ‘xml2’ ...
** package ‘xml2’ successfully unpacked and MD5 sums checked
Package libxml-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libxml-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libxml-2.0' found
Package libxml-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libxml-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libxml-2.0' found
Using PKG_CFLAGS=
Using PKG_LIBS=-lxml2
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because libxml-2.0 was not found. Try installing:
 * deb: libxml2-dev (Debian, Ubuntu, etc)
 * rpm: libxml2-devel (Fedora, CentOS, RHEL)
 * csw: libxml2_dev (Solaris)
If libxml-2.0 is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a libxml-2.0.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 ‘xml2’
* removing ‘/home/pi/R/arm-unknown-linux-gnueabihf-library/3.5/xml2’
ERROR: dependencies ‘curl’, ‘openssl’ are not available for package ‘httr’
* removing ‘/home/pi/R/arm-unknown-linux-gnueabihf-library/3.5/httr’
ERROR: dependencies ‘xml2’, ‘httr’ are not available for package ‘rvest’
* removing ‘/home/pi/R/arm-unknown-linux-gnueabihf-library/3.5/rvest’

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

(StackOverflow说我的帖子主要是代码,我应该再加一些单词,这完全没有意义,因为这是一个关于长代码的短问题。所以,以下是我刚刚在桌面上找到的一些德语单词的字母(大多是愚蠢的账单):- Empfangsquittung- Nebenkostenabrechnung- Promilleanteil-Abrechnung- Zusatzleistungsbarcodes- Liegenschaftsverwaltung- Rückforderungsbeleg)

r linux raspberry-pi rvest
1个回答
0
投票

它说,缺少libcurl。所以,安装吧。

apt install -y libcurl4-openssl-dev
© www.soinside.com 2019 - 2024. All rights reserved.