gpt4 book ai didi

r - 在 R 中安装 ESSURVEY 包时出错

转载 作者:行者123 更新时间:2023-12-04 18:48:08 48 4
gpt4 key购买 nike

我正在尝试安装包“essurvey”。但它只是抛出错误消息。
我正在运行 Ubuntu 20.04 LTS 和 R 版本 4.1.2 (2021-11-01)。

    > install.packages("essurvey")
Installing package into ‘/home/knut/R/x86_64-pc-linux-gnu-library/4.1’
(as ‘lib’ is unspecified)
also installing the dependencies ‘curl’, ‘xml2’, ‘httr’, ‘rvest’

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

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

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

trying URL 'https://cloud.r-project.org/src/contrib/rvest_1.0.2.tar.gz'
Content type 'application/x-gzip' length 94357 bytes (92 KB)
==================================================
downloaded 92 KB

trying URL 'https://cloud.r-project.org/src/contrib/essurvey_1.0.8.tar.gz'
Content type 'application/x-gzip' length 73081 bytes (71 KB)
==================================================
downloaded 71 KB

* installing *source* package ‘curl’ ...
** package ‘curl’ successfully unpacked and MD5 sums checked
** using staged installation
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/knut/R/x86_64-pc-linux-gnu-library/4.1/curl’
Warning in install.packages :
installation of package ‘curl’ had non-zero exit status
* installing *source* package ‘xml2’ ...
** package ‘xml2’ successfully unpacked and MD5 sums checked
** using staged installation
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/knut/R/x86_64-pc-linux-gnu-library/4.1/xml2’
Warning in install.packages :
installation of package ‘xml2’ had non-zero exit status
ERROR: dependency ‘curl’ is not available for package ‘httr’
* removing ‘/home/knut/R/x86_64-pc-linux-gnu-library/4.1/httr’
Warning in install.packages :
installation of package ‘httr’ had non-zero exit status
ERROR: dependencies ‘httr’, ‘xml2’ are not available for package ‘rvest’
* removing ‘/home/knut/R/x86_64-pc-linux-gnu-library/4.1/rvest’
Warning in install.packages :
installation of package ‘rvest’ had non-zero exit status
ERROR: dependencies ‘xml2’, ‘httr’, ‘rvest’ are not available for package ‘essurvey’
* removing ‘/home/knut/R/x86_64-pc-linux-gnu-library/4.1/essurvey’
Warning in install.packages :
installation of package ‘essurvey’ had non-zero exit status

The downloaded source packages are in
‘/tmp/RtmpWcvxK9/downloaded_packages’
我已经尝试安装 curl包和 libcurl4-openssl-dev , libxml2-dev . curl包给了我同样的非零退出状态,和 libcurl4-openssl-dev , libxml2-dev显示:
> install.packages("libcurl4-openssl-dev")
Installing package into ‘/home/knut/R/x86_64-pc-linux-gnu-library/4.1’
(as ‘lib’ is unspecified)
Warning in install.packages :
package ‘libcurl4-openssl-dev’ is not available for this version of R

A version of this package for your version of R might be available elsewhere,
see the ideas at
https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages
我希望我在这里遗漏了一些重要的东西,我一般是编程新手。

最佳答案

Grzegorz Sapijaszko 用这个答案回答了我的问题:
从终端安装软件包:$ sudo apt install libcurl4-openssl-dev .这部分错误:Configuration failed because libcurl was not found. Try installing: * deb: libcurl4-openssl-dev (Debian, Ubuntu, etc)告诉你缺少什么包。libxml2-dev 也是如此: 喜欢 sapi@t5810:~$ sudo apt install libxml2-dev谢谢!

关于r - 在 R 中安装 ESSURVEY 包时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71091416/

48 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com