Error installing RMySQL - r

It took a good amount of time to install RMySQL on my Linux machine but I was able to install it after changing environment variables and copy and paste lib.dll file.
However, I'm now trying to install RMySQL on my 64bit window machine, but so far there's no progress yet for two days. It broke down after "running command sh ./configure.win had status 127 error, and I cannot find what this means.
Can anyone shed some lights on this?
install.packages('RMySQL',type='source')
Installing package into ‘C:/Users/chu/Documents/R/win-library/3.1’
(as ‘lib’ is unspecified)
trying URL 'http://cran.rstudio.com/src/contrib/RMySQL_0.9-3.tar.gz'
Content type 'application/x-gzip' length 165363 bytes (161 Kb)
opened URL
downloaded 161 Kb
* installing *source* package 'RMySQL' ...
** package 'RMySQL' successfully unpacked and MD5 sums checked
Warning: running command 'sh ./configure.win' had status 127
ERROR: configuration failed for package 'RMySQL'
* removing 'C:/Users/chu/Documents/R/win-library/3.1/RMySQL'
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-31~1.0/bin/x64/R" CMD INSTALL -l "C:\Users\chu\Documents\R\win-library\3.1" C:\Users\chu\AppData\Local\Temp\RtmpKA9e7I/downloaded_packages/RMySQL_0.9-3.tar.gz' had status 1
Warning in install.packages :
installation of package ‘RMySQL’ had non-zero exit status
The downloaded source packages are in
‘C:\Users\chu\AppData\Local\Temp\RtmpKA9e7I\downloaded_packages’

for linux users..
install- libmysql first
sudo apt-get install libmysql++-dev
then try.

I was facing the same error. Given below is the link to a way around that worked for me.
http://www.ahschulz.de/2013/07/23/installing-rmysql-under-windows/
In short, the location of library libmysqll.dll required for compilation, had to be changed from lib folder to bin folder of the home directory set for MySQL in environment variables.

By default, R uses the /tmp directory to install packages. On security conscious machines, the /tmp directory is often marked as “noexec” in the /etc/fstab file. This means that no file under /tmp can ever be executed. Packages that require compilation or that have self-inflating data will fail with the error mentioned.
The solution is to set the TMPDIR environment variable outside R (in your shell), which R will use as the compilation directory. How to do this depends on the shell. bash:
mkdir ~/tmp
export TMPDIR=~/tmp
Then R can compile and install the package.

I ran into the same problem while updating packages on Windows server for latest version of R. I solved it by installing from a .zip file vs .tar.gz.
I actually had to go through the process of first downloading the package, and then installing from it (not from mirror) for other reasons.
Here is what it looked like:
pk <- 'caTools'
download.packages(pk, "R-3.2-packages/" ,type = "win.binary")
install.packages(
dir("R-3.2-packages/",pattern=pk,full.names = TRUE),
repos = NULL,
type = "source")
Hope this helps.

Solution if anyone faced the same problem on windows:
Make sure your MYSQL_HOME environment variable is set correctly and libmysql.dll is copied to bin folder!!!
Run install.packages('RMySQL') then when the "Do you want to install from sources..." window pops up select No.
Then copy the downloaded binary packages location from console.
Go to Packages -> Install, paste the location into Package archive and click Install.

Related

Need help installing rJava on Mac

I am trying to download the package Xlconnect on my mac but I keep getting errors. I was able to figure out that it was because mac has some issue with Java and that I need to first resolve that before. But I've had no luck so far.
One of the things I tried was this: https://www.chrisjmendez.com/2018/11/16/installing-xlconnect-and-rjava-on-macos/
But it didn't work as well.
Can someone who has been able to successfully install rJava help me out please?
configure: error: One or more Java configuration variables are not set.
Make sure R is configured with full Java support (including JDK). Run
R CMD javareconf
as root to add Java support to R.
If you don't have root privileges, run
R CMD javareconf -e
to set all Java-related variables and then install rJava.
ERROR: configuration failed for package ‘rJava’
* removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/rJava’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/rJava’
Warning in install.packages :
installation of package ‘rJava’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/47/523c7yns0dvgc2cy147fbxrh0000gn/T/RtmpkLRoEh/downloaded_packages’
It seems as you have not set up your environment with java variables.
Try adding this to either your ~/.zshrc or ~/.basrc
export PATH={PATH_TO_JAVA_INSTALLATION}:$PATH
export JAVA_HOME={SAME_PATH_TO_JAVA_INSTALLATION}
Your Java Path is most likely in /Library/Java/JavaVirtualMachines/{some .jdk file}

Installing R on Hortonworks Sandbox hadoop 2.3

I’m experiencing some troubles when I try to install R dependencies with the command :
install.packages(c(“Rcpp”,”RJSONIO”,”bitops”,”digest”,”functional”,”itertools”,”reshape2″,”string ”,”plyr”,”caTools”),repos=’http://cran.revolutionanalytics.com’)
packages are downloaded but then all I get are the messages
/usr/lib64/R/bin/R: line 8: uname: command not found
/usr/lib64/R/bin/R: line 143: exec: sh: not found
repeated as many times as the number of packages I am trying to install.
I am using R version 3.2.2, rstudio-server 0.99.489 in Hortonworks Sandbox with hadoop 2.3 (Oracle Virtualbox).
Do you have any suggestions?
Thanks for your help.
I know this question was asked 7 months ago. But I just had the same problem stefanod did and I Googled left and right without finding a solution. Then for absolutely no reasonable reason it just worked. Here is what I have tried and what eventually solves my problem:
So I use R 3.2.2, rstudio-server 0.98.994 in Hortonworks Hadoop Sandbox HDP 2.4 in VMWare. I logged in the virtual machine using the Shell Web Client Method. The entire process was done with root privilege. I followed this instruction: https://jsolderitsch.wordpress.com/hortonworks-sandbox-r-and-rstudio-install/ except that I used updated versions of R and RStudio Server. Everything worked fine until I invoked R in the shell and attempted
install.packages('foo.bar', repos='http://cran.revolutionanalytics.com')
Then I had exactly the same error messages as in this Q.
I checked my $PATH and used whereis COMMANDNAME to check if I had the uname command at the right place. Seems I do.
I then quit R. Inside CentOS I used wget to manually download the .tar.gz files of the packages and their dependencies. I then tried to install those packages manually:
[root#sandbox ~]# sudo R CMD INSTALL foo.bar.tar.gz
* installing to library ‘/usr/lib64/R/library’
* installing *source* package ‘foo.bar’ ...
** package ‘foo.bar’ successfully unpacked and MD5 sums checked
** libs
sh: make: command not found
ERROR: compilation failed for package ‘foo.bar’
* removing ‘/usr/lib64/R/library/foo.bar’
sh: rm: command not found
At this time RStudio was already installed. So I logged into RStudio in my browser at port 8787 and tried install.packages in RStudio and every package installed fine.
I guess the take-home message is to install packages inside RStudio instead of inside R in the shell.
BTW I also cannot log in RStudio as root; says invalid username and password.

Error when installing R package using Rstudio

I want to install http://cran.r-project.org/src/contrib/Archive/mecdf/ using RStudio but when I use
> install.packages('C:\\Users\\jandre\\Desktop\\mecdf_0.6.1.tar.gz', repos=NULL, type="source")
I get this error:
Installing package into ‘C:/Users/jandre/Documents/R/win-library/3.1’
(as ‘lib’ is unspecified)
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
Warning in install.packages :
running command '"C:/Program Files/R/R-3.1.1/bin/x64/R" CMD INSTALL -l "C:\Users\jandre\Documents\R\win-library\3.1" "C:/Users/jandre/Desktop/mecdf_0.6.1.tar.gz"' had status 1
Warning in install.packages :
installation of package ‘C:/Users/jandre/Desktop/mecdf_0.6.1.tar.gz’ had non-zero exit status
This occurs in every package I want to install using the tar.gz file. I'm on Win7 x64. RStudio Version 0.98.1028
Can't think of a way to fix this at the moment -- sorry -- but the R administration manual says explicitly:
Note that installing R into a directory whose path contains spaces is not supported, and at least some aspects (such as installing source packages) will not work.
I don't know why this doesn't bite people much more often, given that C:/Program Files/... seems like a relatively normal place to install things on Windows.
I would also expect that the double quotation marks around your R executable name ("C:/Program Files/R/R-3.1.1/bin/x64/R") in the system call should have protected you from this problem ... ?
I had the same error message with the installation of some packages(under Windows 10 OS with R and Rstudio).
It seems that the R software (not R Studio) is dealing with the library where package are installed.
I uninstalled R and Rstudio and installed it a path without space (ex: C:\Program\R).I tried to load the packages that previously failed and it seemed to fix the problem.

Install ggplot2 from local directory

I need to download packages and install from local directory. But I'm having trouble installing ggplot2. I get no warning, but it seems the library is not installed. Output is below, any suggestions? Operating system is Windows. After running, the directory C:...\R\win-library\3.1 contains subdirectory ggplot2-master.
> install.packages("C:/.../packages/ggplot2-master.zip", repos = NULL, type="source")
Installing package into ‘C:/.../R/win-library/3.1’
(as ‘lib’ is unspecified)
> library(ggplot2)
Error in library(ggplot2) : there is no package called ‘ggplot2’
The correct action was to download the binaries instead of the source.
Note, the following command prompts for the file path:
install.packages(file.choose(), repos=NULL)
The computer is behind a firewall, so the install.package command does not work. I should have downloaded the binary install, but downloaded the source by mistake. So, the corrective action is to download the binary files. I want to point out that in my notes on R, it clearly states to download the binary file. Part of the joys of getting older, not remembering why I came into this room.... Also, rambling...

CRAN packages not unpacking on Ubuntu

Think I had done this type of command successfully before
sudo su ­ ­c "R ­e \"install.packages('countrycode', repos='http://cran.rstudio.com/')\""
the screen reports
Installing package into '/usr/local/lib/R/site-library'
which is where other packages reside
I then get
downloaded 28kb
and it just says that the source packages are in a tmp folder before returning to the prompt
This should work,
sudo R ­-e "install.packages('countrycode', repos='http://cran.rstudio.com/')"
You will be asked to type in your password and then it starts downloading and installation ...

Resources