configuration failed for xml2 while installing tidyverse in r studio - r

system: ubuntu 18.04
Rstudio version 3.4.4
Whenever i try to install tidyverse this error comes up, how do i add the directory containing the lib-curl to the package configuration search path?
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
.
.
.
.
ERROR: configuration failed for package ‘xml2’
removing ‘/home/javed/R/x86_64-pc-linux-gnu-library/3.4/xml2’
Warning in install.packages :
installation of package ‘xml2’ had non-zero exit status
ERROR: dependencies ‘curl’, ‘openssl’ are not available for package ‘httr’
* removing ‘/home/javed/R/x86_64-pc-linux-gnu-library/3.4/httr’
Warning in install.packages :
installation of package ‘httr’ had non-zero exit status
ERROR: dependencies ‘xml2’, ‘httr’ are not available for package ‘rvest’
* removing ‘/home/javed/R/x86_64-pc-linux-gnu-library/3.4/rvest’
Warning in install.packages :
installation of package ‘rvest’ had non-zero exit status
ERROR: dependencies ‘httr’, ‘rvest’, ‘xml2’ are not available for package ‘tidyverse’
* removing ‘/home/javed/R/x86_64-pc-linux-gnu-library/3.4/tidyverse’
Warning in install.packages :
installation of package ‘tidyverse’ had non-zero exit status

Install these missing dependencies before installing R packages:
sudo apt install libcurl4-openssl-dev libssl-dev libxml2-dev
Source: https://blog.zenggyu.com/en/post/2018-01-29/installing-r-r-packages-e-g-tidyverse-and-rstudio-on-ubuntu-linux/

Quit R and open up a command window and confirm that libcurl is indeed not installed on Ubuntu
apt list --installed | grep libcurl
You should see no results.
Install the package
sudo apt update
sudo apt install libcurl4-openssl-dev
Open up R and reinstall tidyverse.
If you still get error messages in R, you might have to install additional missing Linux packages by repeating similar steps.

Related

Install AER package of R on AWS E2

I am having trouble in installing "AER" on my AWS E2.
The following is the message:
------------------ CMAKE NOT FOUND --------------------
CMake was not found on the PATH. Please install CMake:
sudo yum install cmake (Fedora/CentOS; inside a terminal)
sudo apt install cmake (Debian/Ubuntu; inside a terminal).
sudo pacman -S cmake (Arch Linux; inside a terminal).
sudo brew install cmake (MacOS; inside a terminal with Homebrew)
sudo port install cmake (MacOS; inside a terminal with MacPorts)
Alternatively install CMake from: https://cmake.org/
ERROR: configuration failed for package ‘nloptr’
removing ‘/home/rstudio/R/x86_64-pc-linux-gnu-library/4.0/nloptr’
Warning in install.packages :
installation of package ‘nloptr’ had non-zero exit status
ERROR: dependency ‘nloptr’ is not available for package ‘lme4’
removing ‘/home/rstudio/R/x86_64-pc-linux-gnu-library/4.0/lme4’
Warning in install.packages :
installation of package ‘lme4’ had non-zero exit status
ERROR: dependency ‘lme4’ is not available for package ‘pbkrtest’
removing ‘/home/rstudio/R/x86_64-pc-linux-gnu-library/4.0/pbkrtest’
Warning in install.packages :
installation of package ‘pbkrtest’ had non-zero exit status
ERROR: dependencies ‘pbkrtest’, ‘lme4’ are not available for package ‘car’
removing ‘/home/rstudio/R/x86_64-pc-linux-gnu-library/4.0/car’
Warning in install.packages :
installation of package ‘car’ had non-zero exit status
ERROR: dependency ‘car’ is not available for package ‘ivreg’
removing ‘/home/rstudio/R/x86_64-pc-linux-gnu-library/4.0/ivreg’
Warning in install.packages :
installation of package ‘ivreg’ had non-zero exit status

ERROR while installing "swirl" package in Rstudio

i tried to install "swirl" but i got this error
ERROR: configuration failed for package ‘openssl’
* removing ‘/home/mahmoudelshaer/R/x86_64-redhat-linux-gnu-library/3.6/openssl’
Warning in install.packages :
installation of package ‘openssl’ had non-zero exit status
* installing source package ‘RCurl’ ...
** package ‘RCurl’ successfully unpacked and MD5 sums checked
** using staged installation
checking for curl-config... no
Cannot find curl-config
ERROR: configuration failed for package ‘RCurl’
* removing ‘/home/mahmoudelshaer/R/x86_64-redhat-linux-gnu-library/3.6/RCurl’
Warning in install.packages :
installation of package ‘RCurl’ had non-zero exit status
ERROR: dependencies ‘curl’, ‘openssl’ are not available for package ‘httr’
* removing ‘/home/mahmoudelshaer/R/x86_64-redhat-linux-gnu-library/3.6/httr’
Warning in install.packages :
installation of package ‘httr’ had non-zero exit status
ERROR: dependencies ‘httr’, ‘RCurl’ are not available for package ‘swirl’
* removing ‘/home/mahmoudelshaer/R/x86_64-redhat-linux-gnu-library/3.6/swirl’
Warning in install.packages :
installation of package ‘swirl’ had non-zero exit status
The downloaded source packages are in
‘/tmp/RtmpkcuO45/downloaded_packages’
library("Swirl")
Error in library("Swirl") : there is no package called ‘Swirl’
i also tried solution from other similar question
sudo dnf install libssl-dev
Last metadata expiration check: 0:18:30 ago on Wed 27 May 2020 11:37:04 AM EET.
No match for argument: libssl-dev
Error: Unable to find a match: libssl-dev
I solve it
As a Fedora 32 user, i run those commands in terminal and they solved my problem
1st
sudo dnf install libcurl4-openssl-dev
2nd
sudo dnf groupinstall 'Development Tools' 'Development Libraries'
3rd
sudo dnf install zlib-devel libyaml-devel openssl-devel gdbm-devel readline-devel ncurses-devel libffi-devel curl git openssh-server redis libxml2-devel libxslt-devel libcurl-devel libicu-devel python
then in RStudio i typed
install.packages("swirl", dependencies = TRUE)
and it worked successfully
to check##
library("swirl")
| Hi! Type swirl() when you are ready to begin.

Unable To Install Tidyverse Due To Libcurl Issue

I recently upgraded to R 3.5 and have been unable to install the 'tidyverse' package. Other packages are installing fine. Whenever I try to install tidyverse, I receive the following error message.
* installing *source* package ‘curl’ ...
** package ‘curl’ successfully unpacked and MD5 sums checked
Found pkg-config cflags and libs!
Using PKG_CFLAGS=-I/usr/include/x86_64-linux-gnu
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/nik/anaconda3/lib/R/library/curl’
ERROR: dependency ‘curl’ is not available for package ‘httr’
* removing ‘/home/nik/anaconda3/lib/R/library/httr’
ERROR: dependency ‘httr’ is not available for package ‘rvest’
* removing ‘/home/nik/anaconda3/lib/R/library/rvest’
ERROR: dependencies ‘httr’, ‘rvest’ are not available for package ‘tidyverse’
* removing ‘/home/nik/anaconda3/lib/R/library/tidyverse’
The downloaded source packages are in
‘/tmp/RtmpHJ48Sk/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning messages:
1: In install.packages("tidyverse") :
installation of package ‘curl’ had non-zero exit status
2: In install.packages("tidyverse") :
installation of package ‘httr’ had non-zero exit status
3: In install.packages("tidyverse") :
installation of package ‘rvest’ had non-zero exit status
4: In install.packages("tidyverse") :
installation of package ‘tidyverse’ had non-zero exit status
I have run sudo apt-get install libcurl4-openssl-dev as has been suggested on other threads for the same problem. However, this does not appear to resolve the issue (in fact, libcurl was already installed, and reinstalling it also did not work).
When I check $PATH, I do not see 'pkg-config', and PKG_CONFIG_PATH does not seem to exist. Adding /usr/bin/pkg-config to the path and setting PKG_CONFIG_PATH /home/nik/anaconda3/lib/pkgconfig/libcurl.pc also does not appear to have fixed the issue. I'm at wits end at this point, as I can't think of anything else to uninstall/reinstall, nor figure out why libcurl isn't being added to the path on its own when I install it. Any help at all would be appreciated.
try setting your path to the directory that contains libcurl and not to libcurl itself, i.e.
PKG_CONFIG_PATH=/home/nik/anaconda3/lib/pkgconfig

Installation of archived package "prob" not working in R

I'm running R 3.4.2 and R Studio 1.0.153. I want to install the prob package in R. The prob package in an archived file. It is located here. I am trying to install the prob_1.0-0.tar.gz package. I have no problem downloading and opening the package archive file. The code is below, it seems I need to install the fAsianOptions package.
ERROR: dependency 'fAsianOptions' is not available for package 'prob'
* removing 'C:/Users/blake_000/Documents/R/win-library/3.4/prob' Warning in install.packages : running command
'"C:/PROGRA~1/R/R-34~1.2/bin/x64/R" CMD INSTALL -l
"C:\Users\blake_000\Documents\R\win-library\3.4"
"C:/Users/BLAKE_~1/GOOGLE~1/Life/CSUEB/FALL20~1/6204-P~1/RCODE~1/prob_1.0-0.tar.gz"'
had status 1 Warning in install.packages : installation of package
‘C:/Users/BLAKE_~1/GOOGLE~1/Life/CSUEB/FALL20~1/6204-P~1/RCODE~1/prob_1.0-0.tar.gz’
had non-zero exit status
Unfortunately, the fAsianOptions package is also archived. It is located here and I downloaded version fAsianOptions_3010.79.tar.gz. There were a number of dependencies but I installed the required packages (timeDate, timeSeries, etc.)
However, the fAsianOptions package is not installing. The error code reads as follows:
install.packages("C:/Users/blake_000/Google Drive/Life/CSUEB/Fall
2017/6204- Probability/R Code/fAsianOptions_3010.79.tar.gz", repos =
NULL, type = "source") Installing package into
‘C:/Users/blake_000/Documents/R/win-library/3.4’ (as ‘lib’ is
unspecified)
* installing source package 'fAsianOptions' ...
** package 'fAsianOptions' successfully unpacked and MD5 sums checked
** libs
*** arch - i386 Warning: running command 'make -f "Makevars" -f "C:/PROGRA~1/R/R-34~1.2/etc/i386/Makeconf" -f
"C:/PROGRA~1/R/R-34~1.2/share/make/winshlib.mk"
SHLIB="fAsianOptions.dll" SHLIB_LIBADD='$(FLIBS)'
OBJECTS="EBMAsianOptions.o GammaFunctions.o
HypergeometricFunctions.o"' had status 127 ERROR: compilation failed
for package 'fAsianOptions'
* removing 'C:/Users/blake_000/Documents/R/win-library/3.4/fAsianOptions' Warning
in install.packages : running command
'"C:/PROGRA~1/R/R-34~1.2/bin/x64/R" CMD INSTALL -l
"C:\Users\blake_000\Documents\R\win-library\3.4"
"C:/Users/BLAKE_~1/GOOGLE~1/Life/CSUEB/FALL20~1/6204-P~1/RCODE~1/fAsianOptions_3010.79.tar.gz"'
had status 1 Warning in install.packages : installation of package
‘C:/Users/BLAKE_~1/GOOGLE~1/Life/CSUEB/FALL20~1/6204-P~1/RCODE~1/fAsianOptions_3010.79.tar.gz’
had non-zero exit status
I'm hoping that someone can help me to install the fAsianOptions dependency so I can install the prob package. Or, if there's an easier way, please let me know!
I had the same problem. I solved it by installing lower version of R -2.9. prob is available in repository for this version.

Failed to install devtools in R 3.1.2

I was trying to install the devtools package in Rstudio by install.packages("devtools") but failed. The error messages are:
* 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
Could not find libxml2. Please install libxml2-devel (rpm) or libxml2-dev (deb).
ERROR: configuration failed for package ‘xml2’
* removing ‘/home/xwang/R/x86_64-pc-linux-gnu-library/3.1/xml2’
Warning in install.packages :
installation of package ‘xml2’ had non-zero exit status
ERROR: dependency ‘xml2’ is not available for package ‘rversions’
* removing ‘/home/xwang/R/x86_64-pc-linux-gnu-library/3.1/rversions’
Warning in install.packages :
installation of package ‘rversions’ had non-zero exit status
ERROR: dependency ‘rversions’ is not available for package ‘devtools’
* removing ‘/home/xwang/R/x86_64-pc-linux-gnu-library/3.1/devtools’
Warning in install.packages :
installation of package ‘devtools’ had non-zero exit status
The downloaded source packages are in
‘/tmp/RtmpYccDpT/downloaded_packages’
Looks like it has trouble finding libxml-2.0. Does anyone know an easy fix to this? I'm using R version 3.1.2.
Eventually I fixed the problem by:
sudo apt-get install libxml2-dev
Then another problems popped up:
Error : object ‘curl_fetch_memory’ is not exported by 'namespace:curl'
which can be solved by installing the curl package:
install.packages("curl")
You just need to update to the newest version of R (R version 3.2.1)
It require some developer libraries (sources): curl developer, xml2 developer as dependecy.
so install it with the package repository (yum, dnf, apt-get) and retry to install the devtools package in R.

Resources