Cannot Install RMySQL on CENTOS - r

I am finding it very difficult to install the "RMySQL" package on CENTOS.
install.packages("RMySQL", dependencies = TRUE, repos = "http://cran.rstudio.com/")
The error it is throwing me is:
* installing *source* package ‘RMySQL’ ...
** package ‘RMySQL’ successfully unpacked and MD5 sums checked
Using PKG_CFLAGS=
Using PKG_LIBS=-lmysqlclient
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because libmysqlclient was not found. Try installing:
* deb: libmariadb-client-lgpl-dev (Debian, Ubuntu 16.04)
libmariadbclient-dev (Ubuntu 14.04)
* rpm: mariadb-devel | mysql-devel (Fedora, CentOS, RHEL)
* csw: mysql56_dev (Solaris)
* brew: mariadb-connector-c (OSX)
If libmysqlclient is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a libmysqlclient.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 ‘RMySQL’
* removing ‘/usr/local/lib64/R/library/RMySQL’
The downloaded source packages are in
‘/tmp/RtmpbFMPmO/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning message:
In install.packages("RMySQL", dependencies = TRUE, repos = "http://cran.rstudio.com/") :
installation of package ‘RMySQL’ had non-zero exit status
I have already installed yum update mysql-devel but still get the same error.
Any help will be appreciated as I have been trying to figure his out since last 2 days.

Related

installing RMySQL package on Mac Catallina

I tried to install RMySQL package in my Rstudio, and when I tried it, it gave me following error
> install.packages("RMySQL")
Installing package into ‘/Users/haeseongmoon/Library/R/3.6/library’
(as ‘lib’ is unspecified)
Warning in install.packages :
unable to access index for repository https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6:
cannot open URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/PACKAGES'
Package which is only available in source form, and may need compilation of
C/C++/Fortran: ‘RMySQL’
Do you want to attempt to install these from sources? (Yes/no/cancel) Yes
installing the source package ‘RMySQL’
trying URL 'https://cran.rstudio.com/src/contrib/RMySQL_0.10.20.tar.gz'
Content type 'application/x-gzip' length 52900 bytes (51 KB)
==================================================
downloaded 51 KB
* installing *source* package ‘RMySQL’ ...
** package ‘RMySQL’ successfully unpacked and MD5 sums checked
** using staged installation
Using PKG_CFLAGS=
Using PKG_LIBS=-lmysqlclient
-----------------------------[ ANTICONF ]-----------------------------
Configure could not find suitable mysql/mariadb client library. Try installing:
* deb: libmariadbclient-dev | libmariadb-client-lgpl-dev (Debian, Ubuntu)
* rpm: mariadb-connector-c-devel | mariadb-devel | mysql-devel (Fedora, CentOS, RHEL)
* csw: mysql56_dev (Solaris)
* brew: mariadb-connector-c (OSX)
If you already have a mysql client library installed, verify that either
mariadb_config or mysql_config is on your PATH. If these are unavailable
you can also set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
--------------------------[ ERROR MESSAGE ]----------------------------
<stdin>:1:10: fatal error: 'mysql.h' file not found
#include <mysql.h>
^~~~~~~~~
1 error generated.
-----------------------------------------------------------------------
ERROR: configuration failed for package ‘RMySQL’
* removing ‘/Users/haeseongmoon/Library/R/3.6/library/RMySQL’
Warning in install.packages :
installation of package ‘RMySQL’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/c6/qgbzrx0s4zq7gdbhzz43gqhw0000gn/T/RtmpOozjqL/downloaded_packages’
I tried various solutionns that I found while I was doing googling, but it didn't workout.
How can I install RMySQL?
Thankfully, the error tells you exactly what to do.
Configure could not find suitable mysql/mariadb client library. Try installing:
* deb: libmariadbclient-dev | libmariadb-client-lgpl-dev (Debian, Ubuntu)
* rpm: mariadb-connector-c-devel | mariadb-devel | mysql-devel (Fedora, CentOS, RHEL)
* csw: mysql56_dev (Solaris)
* brew: mariadb-connector-c (OSX)
You need to use homebrew to install mariadb-connector-c.
brew install mariadb-connector-c
If you don't have homebrew yet, check out this page.

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

Error installing swirl in R ver 3.4.1 32-bit Debian

I am trying to install swirl in R ver 3.4.1 32-bit on Debian wheezyx and am getting errors. Please see below:
------------------------- 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 '/usr/local/lib/R/site-library/curl'
* installing *source* package 'openssl' ...
** package 'openssl' successfully unpacked and MD5 sums
checked
Found pkg-config cflags and libs!
Using PKG_CFLAGS=
Using PKG_LIBS=-lssl -lcrypto
------------------------- 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=...'
--------------------------------------------------------------------
I then tried to install libcurl4-openssl-dev but get the following error. I'm not sure what to do next...
> install.packages("libcurl4-openssl-dev")
Installing package into '/usr/local/lib/R/site-library'
(as 'lib' is unspecified)
Warning message:
package 'libcurl4-openssl-dev' is not available (for R version 3.4.1)
>
I tried to install libcurl4-openssl-dev as a Debian package and this is the output I received.
Setting up dropbear (2014.65-1+deb8u2) ...
Restarting Dropbear SSH server: invoke-rc.d: initscript
dropbear, action "restart" failed.
dpkg: error processing package dropbear (--
configure):
subprocess installed post-installation script returned
error exit status 1
Errors were encountered while processing:
dropbear
E: Sub-process /usr/bin/dpkg returned an error code
(1)
After I run the package the issue still exist.
First try from the terminal:
sudo apt-get install libcurl4-openssl-dev libssl-dev
later go back to Rstudio and install swirl package again.

Error when installing swirl in RStudio 3.1.2

Hey I tried installing swirl running the following command:
install.packages("swirl")
I got the following error:
------------------------- 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/franco/R/x86_64-pc-linux-gnu-library/3.1/curl’
Warning in install.packages :
installation of package ‘curl’ had non-zero exit status
* installing *source* package ‘RCurl’ ...
** package ‘RCurl’ successfully unpacked and MD5 sums checked
checking for curl-config... no
Cannot find curl-config
ERROR: configuration failed for package ‘RCurl’
* removing ‘/home/franco/R/x86_64-pc-linux-gnu-library/3.1/RCurl’
Warning in install.packages :
installation of package ‘RCurl’ had non-zero exit status
ERROR: dependency ‘curl’ is not available for package ‘httr’
* removing ‘/home/franco/R/x86_64-pc-linux-gnu-library/3.1/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/franco/R/x86_64-pc-linux-gnu-library/3.1/swirl’
Warning in install.packages :
installation of package ‘swirl’ had non-zero exit status
The downloaded source packages are in
‘/tmp/Rtmp7G87EM/downloaded_packages’
I tried installing "curl" and "RCurl" packages but I got the same error messages. I don't know how to change the path as directed in the ANTICONF ERROR.
I'm running Ubuntu 15.04 and R version 3.1.2 (2014-10-31)
now it's
sudo apt-get install libcurl4-gnutls-dev
Updated as on 30-05-2019:
I am using Ubuntu 16.04
I got this while installing the packages-
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=...'
I used the command in terminal >
sudo apt-get install libssl-dev
And then it worked fine.

Failed install R package RMySQL on CentOS 6.5 "because mysql-connector-c was not found"

I'm installing RMySQL within R terminal under CentOS 6.5 but received the following error message:
* installing to library ‘/usr/lib64/R/library’
* installing *source* package ‘RMySQL’ ...
** 成功将‘RMySQL’程序包解包并MD5和检查
Found INCLUDE_DIR and/or LIB_DIR!
Using PKG_CFLAGS=-I/usr/local/lib64/R/include/include
Using PKG_LIBS=-L/usr/local/lib64/R/lib -lmysqlclient -lz
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because mysql-connector-c was not found. Try installing:
* deb: libmysqlclient-dev | libmariadbclient-dev (Debian, Ubuntu)
* rpm: mariadb-devel | mysql-devel (Fedora, CentOS, RHEL)
* csw: mysql56_dev (Solaris)
* brew: mysql-connector-c (OSX)
If mysql-connector-c is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a mysql-connector-c.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 ‘RMySQL’
* removing ‘/usr/lib64/R/library/RMySQL’
Here's additional info:
I've installed mysql-devel as required through yum
PKG_CONFIG_PATH has been set to "/usr/lib64/pkgconfig:/usr/share/pkgconfig:/usr/local/lib/pkgconfig" however I'm unable to locate the file "mysql-connector-c.pc" on the entire system.
I've been stuck here for 2 days and would really appreciate your help and advice! Thank you!
You can search for mysql-connector-c at http://rpm.pbone.net/ to get an overview.
Note that no mysql-connector-c packages are available for CentOS. Only appears when searching Redhat EL6 and EL7.
Also be aware that none of the "mysql-connector-c-devel" packages seems to have a file "mysql-connector-c.pc"

Resources