在树莓派 pi/linux 上安装 r 包 ('rvest'):为什么我的配置失败?

installing r packages ('rvest') on raspberry pi/linux: why does my configuration fail?

我正在尝试 运行 我的网络抓取工具 raspberry pi 但总是失败。我从未使用过 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: 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/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

(Whosebug 说我的 post 主要是代码,我应该添加更多的单词,这完全没有意义,因为这是一个关于长代码的简短问题。所以,这是我刚刚找到的一些德语单词在我桌面上的信件中(主要是愚蠢的账单): - Empfangsquittung - Nebenkostenabrechnung - Promilleanteil-Abrechnung - Zusatzleistungsbarcodes - Liegenschaftsverwaltung - Rückforde运行gsbeleg )

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

apt install -y libcurl4-openssl-dev