'Error when installing ESSURVEY package in R
I am trying to install the package "essurvey". But it is just throwing out error messages.
I am running Ubuntu 20.04 LTS and R version 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’
I have tried installing both the curl package and libcurl4-openssl-dev,libxml2-dev. The curl package gives me the same non-zero exit status, and libcurl4-openssl-dev,libxml2-dev shows:
> 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
I hope I am missing something big here, I am new to programming in general.
Solution 1:[1]
Grzegorz Sapijaszko answered my question with this answer:
From terminal install the package as: $ sudo apt install libcurl4-openssl-dev. THis part of error: Configuration failed because libcurl was not found. Try installing: * deb: libcurl4-openssl-dev (Debian, Ubuntu, etc) tells you what packatge is missing.
The same for libxml2-dev: like sapi@t5810:~$ sudo apt install libxml2-dev
Thank you!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | OptimisticKnut |
