Issue in installation of mxnet package in R - r

mxnet package is not installing in r (on windows 10) when I follow the steps given in its documentation.
install.packages("drat", repos="https://cran.rstudio.com")
drat:::addRepo("dmlc")
install.packages("mxnet")
It gives the following result
Installing package into ‘C:/Users/Ashish/Documents/R/win-library/3.3’
(as ‘lib’ is unspecified) Warning in install.packages : cannot open
URL 'http://dmlc.github.io/drat/bin/windows/contrib/3.3/PACKAGES.gz':
HTTP status was '404 Not Found' Warning in install.packages : cannot
open URL
'http://dmlc.github.io/drat/bin/windows/contrib/3.3/PACKAGES': HTTP
status was '404 Not Found' Warning in install.packages : unable to
access index for repository
http://dmlc.github.io/drat/bin/windows/contrib/3.3: cannot open URL
'http://dmlc.github.io/drat/bin/windows/contrib/3.3/PACKAGES' Package
which is only available in source form, and may need compilation of
C/C++/Fortran: ‘mxnet’ Do you want to attempt to install these from
sources? y/n: y installing the source package ‘mxnet’
trying URL 'http://dmlc.github.io/drat/src/contrib/mxnet_0.5.tar.gz'
Warning in install.packages : cannot open URL
'http://dmlc.github.io/drat/src/contrib/mxnet_0.5.tar.gz': HTTP status
was '404 Not Found' Error in download.file(url, destfile, method, mode
= "wb", ...) : cannot open URL 'http://dmlc.github.io/drat/src/contrib/mxnet_0.5.tar.gz' Warning in
install.packages : download of package ‘mxnet’ failed
Kindly help me resolve this issue. I'm using R version 3.3.0. Is there any other way of installing it in R?

I was able to install it successfully by first downloading its zip file from the following link
https://github.com/dmlc/drat/tree/gh-pages/bin/windows/contrib/3.2
and then installing it using RStudio.
I hope this answer will help anyone else facing the same problem.

I had the same issue and was able to resolve it by following the instructions on this page and choosing the correct OS, Language and CPU/GPU options:
http://mxnet.io/get_started/install.html

The only thing that worked for me was to download the mxnet.zip file to a folder, (set it as working directory) and type:
install.packages("mxnet.zip", repos=NULL, type="win.binary")

You can try using different repo in repos.
Otherwise you can download the drat package along with dependencies and install manually.
Check if these URLs are accessible from your machine or not.
Following links will be helpful for you:
http://mxnet-bing.readthedocs.io/en/latest/build.html#r-package-installation
https://github.com/dmlc/mxnet/issues/1085

The more up-to-date Installation Guide is currently located here:
http://mxnet.io/get_started/setup.html#installing-mxnet
I found the paragraph about the installation of the R-package on Windows to be very well written.
By the way, the install.packages("mxnet") command installs a very long tool chain, so it might happen that a package is currently not indexed correctly in the dmlc-repo (i.e. because it was just updated to a newer version on CRAN): Error: package <pkgname> is not available for R version 3.3.1 So you might want to install the "offending" package from the CRAN (or download the sourcecode and use something like install.packages(file.choose(), repos = NULL, type = "source")), then continue with another call to install.packages("mxnet").

try these commands to install mxnet package:--
cran <- getOption("repos")
cran["dmlc"] <- "https://s3-us-west-2.amazonaws.com/apache-mxnet/R/CRAN/"
options(repos = cran)
install.packages("mxnet")

Related

Error installing package mxnet in r 4.0.3 on Mac

I need to install the package MXNET on a Mac OS.
I have tried
install.packages("mxnet")
and get the following error
Warning in install.packages :
unable to access index for repository https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/R/CRAN/23/src/contrib:
impossibile aprire URL 'https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/R/CRAN/23/src/contrib/PACKAGES'
Warning in install.packages :
unable to access index for repository https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/R/CRAN/23/src/contrib:
impossibile aprire URL 'https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/R/CRAN/23/src/contrib/PACKAGES'
Warning in install.packages :
package ‘mxnet’ 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
Warning in install.packages :
unable to access index for repository https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/R/CRAN/23/bin/macosx/contrib/4.0:
impossibile aprire URL 'https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/R/CRAN/23/bin/macosx/contrib/4.0/PACKAGES'
Online solutions do not seem to work for my version of r and I keep getting the same error message as above.
I tried specifying the repository as follows with no luck
cran <- getOption("repos")
cran["dmlc"] <- "https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/R/CRAN/23"
options(repos = cran)
install.packages("mxnet")
Another option I tried is
install.packages("drat", repos="https://cran.rstudio.com")
drat:::addRepo("dmlc")
install.packages("mxnet")
require(devtools)
install_version("DiagrammeR", version = "0.8.1", repos = "http://cran.us.r-project.org")
require(mxnet)
This does not return an error when installing, but if I run something as easy as
mx.set.seed(0)
I get a message saying there is no function mx.set.seed
Does someone know if I can download a zip file for the package and import it manually into r, or if there is a simpler way of doing this?
Thank you

Package ‘Rstem’ is not available (for R version 3.5.1)

I am trying to install the Rstem package, but I am getting the message that there is no version available for the version of R 3.5.1. I'm using the macOs El Captain.
The error is:
> install.packages('Rstem', repos = 'https://cran.r-project.org/src/contrib/Archive/Rstem/Rstem_0.4-1.tar.gz')
Installing package into ‘/Users/ls_rafael/Library/R/3.5/library’
(as ‘lib’ is unspecified)
Warning in install.packages :
unable to access index for repository https://cran.r-project.org/src/contrib/Archive/Rstem/Rstem_0.4-1.tar.gz/src/contrib:
cannot open URL 'https://cran.r-project.org/src/contrib/Archive/Rstem/Rstem_0.4-1.tar.gz/src/contrib/PACKAGES'
Warning in install.packages :
package ‘Rstem’ is not available (for R version 3.5.1)
Warning in install.packages :
unable to access index for repository https://cran.r-project.org/src/contrib/Archive/Rstem/Rstem_0.4-1.tar.gz/bin/macosx/el-capitan/contrib/3.5:
cannot open URL 'https://cran.r-project.org/src/contrib/Archive/Rstem/Rstem_0.4-1.tar.gz/bin/macosx/el-capitan/contrib/3.5/PACKAGES'
I already tried the suggested options in this link issues in installing Rstem package and also downloading the package locally from the official website Rstem Package, but the result is also unsatisfactory.
I'm studying how to do an sentiment analysis with Twitter data. I would like to know if there is any alternative to this package or if there is any trick to install it.
RStem package has been removed from the CRAN repository. You can download using the following command:-
install.packages('Rstem', repos = "http://www.omegahat.net/R")
Make sure you have RTools installed on your machine. You can download it from this link -
Building R for Windows
RStem is now provided by OmegaHat.
Try the command below:
install.packages("Rstem", repos = "http://www.omegahat.net/R", type = "source")

How can I install readxl package for R?

I am trying to install readxl package for R.
The following is the RStudio output:
To learn more and/or disable this warning message see the "Use secure download method for HTTP" option in Tools -> Global Options -> Packages.
> library('readxl')
Error in library("readxl") : there is no package called ‘readxl’
> install.packages("readxl")
Warning in install.packages :
unable to access index for repository http://cran.rstudio.com/src/contrib:
cannot open URL 'http://cran.rstudio.com/src/contrib/PACKAGES'
Installing package into ‘C:/Users/Lenovo/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)
Warning in install.packages :
unable to access index for repository http://cran.rstudio.com/src/contrib:
cannot open URL 'http://cran.rstudio.com/src/contrib/PACKAGES'
Warning in install.packages :
package ‘readxl’ is not available (for R version 3.5.0)
Warning in install.packages :
unable to access index for repository http://cran.rstudio.com/bin/windows/contrib/3.5:
cannot open URL 'http://cran.rstudio.com/bin/windows/contrib/3.5/PACKAGES'
>
The following is the R's console output:
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> install.packages("readxl")
Installing package into ‘C:/Users/Lenovo/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)
--- Please select a CRAN mirror for use in this session ---
Warning: failed to download mirrors file (cannot open URL 'https://cran.r-project.org/CRAN_mirrors.csv'); using local file 'C:/PROGRA~1/R/R-35~1.0/doc/CRAN_mirrors.csv'
Warning: unable to access index for repository https://cloud.r-project.org/src/contrib:
cannot open URL 'https://cloud.r-project.org/src/contrib/PACKAGES'
Warning: unable to access index for repository https://cloud.r-project.org/bin/windows/contrib/3.5:
cannot open URL 'https://cloud.r-project.org/bin/windows/contrib/3.5/PACKAGES'
Warning messages:
1: In download.file(url, destfile = f, quiet = TRUE) :
InternetOpenUrl failed: ''
2: package ‘readxl’ is not available (for R version 3.5.0)
>
How can I solve this issue?
The error messages definitely seem to be telling you, that R cannot connect to download the packages. Here are some thoughts:
Does your user profile have administrative privileges? I am not a huge Windows user, but your are technically trying to add software, which sometimes requires escalated privileges. Maybe trying running R as Admin in windows, for this one issue to see if that is the problem. (Doesn't seem very likely.)
If it is a firewall issue you could try to add an exception to your firewall settings for R and/or Cran repositories.
Have your tried to account for dependent packages? install.packages("readxl", dependencies = TRUE) (This can cause its own bag of issues as well, so consider yourself forewarned.)
Can you download any other packages? As you can access the internet to make stack posts, are asking a fairly entry level question, and the URL's are valid so there may be a configuration issue with your installation of R. If all else fails, you may wish to uninstall/reinstall R on your system (and Maybe R studio while you are at it) as that may help to repair something if it is damaged. Use the file checksums, the are there for a reason.

Have trouble installing ggExtra in RStudio

When I try to library "ggExtra" in RStudio with code below:
install.packages("ggExtra")
what displayed is:
Warning in install.packages :
unable to access index for repository
https://cran.rstudio.com/src/contrib:
cannot open URL 'https://cran.rstudio.com/src/contrib/PACKAGES'
Warning in install.packages :
unable to access index for repository
http://www.stats.ox.ac.uk/pub/RWin/src/contrib:
cannot open URL
'http://www.stats.ox.ac.uk/pub/RWin/src/contrib/PACKAGES'
Installing package into ‘C:/Users/Kyrie NI/Documents/R/win-library/3.4’
(as ‘lib’ is unspecified)
I also tried:
install.packages("devtools")
devtools::install_github("daattali/ggExtra")
And I received the same results. What is wrong with my operation, or the package?
I had a similar problem using R 3.5.0, and found an online solution working as following. It seems I needed to set a default CRAN mirror by adding the first line. Then I update my R into version 3.5.1 to be able to library it. I hope it helps you too.
options(repos = c(CRAN = "http://cran.rstudio.com"))
install.packages("ggExtra")
The original idea comes from:
https://support.rstudio.com/hc/en-us/community/posts/205198138-packages-installation-problem

r error on installing colorspace for ggplot2

I am an r newbie and would appreciate some help installing ggplot2. I am using RStudio Version 0.98.1102. Please see error below.
install.packages("ggplot2")
runs fine
library("ggplot2")
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck =
vI[[i]]) : there is no package called ‘colorspace’ Error: package or
namespace load failed for ‘ggplot2’
install.packages("colorspace")
Installing package into ‘C:/Users/Jessica/Documents/R/win-library/3.1’
(as ‘lib’ is unspecified) There is a binary version available (and
will be installed) but the source version is later: binary source
colorspace 1.2-4 1.2-5 trying URL
'...//cran.rstudio.com/bin/windows/contrib/3.1/colorspace_1.2-4.zip'
Warning in install.packages : cannot open: HTTP status was '404 Not
Found' Error in download.file(url, destfile, method, mode = "wb", ...)
: cannot open URL
'...://cran.rstudio.com/bin/windows/contrib/3.1/colorspace_1.2-4.zip'
Warning in install.packages : download of package ‘colorspace’ failed
Looks like something is a bit messed up with the package meta-information or something in your Rstudio installation. A simple work-around to try is to just download the latest colorspace zip file from here: http://cran.r-project.org/web/packages/colorspace/index.html
Then install by running install.packages("c:/path/to/downloaded/zip/file/colorspace_1.2-5.zip")
When you type in install.packages("ggplot2") into the console, RStudio is pre-programmed to also install the dependencies (i.e. the other packages ggplot needs to run properly). In this case, the issue appears to be with the colorspace package not being able to installed. This is likely because you're running Yosemite and when RStudio looks to install colorspace, it searches for it on the CRAN, it can't find it for some reason:
cannot open URL 'http://cran.rstudio.com/bin/macosx/mavericks/contrib/3.1/colorspace_1.2-4.tgz'
You should be able to overcome this by installing the colorspace package yourself via the CRAN: http://cran.r-project.org/web/packages/colorspace/index.html.
Similar to the original question, I recently encountered this issue with colormap 2.0.0, ggplot2 3.3.2, R 4.0.3, and RStudio 1.3.1093 on Windows. install.packages("ggplot2") reports success even though it does not install colormap and library(ggplot2) therefore fails. In my case, install.packages("colormap") failed to locate the 2.0.0 binaries, retrieving the 1.4.1 sources instead. Downloading the 2.0.0 binary from https://CRAN.R-project.org/package=colorspace, as suggested in other answers, failed with
> install.packages("C:/Users/<username>/Downloads/colorspace_2.0-0.zip") # note use of forward slashes to avoid the backlash escaping problems #Paul M mentions in his comment on #L P's answer -- \\ instead of just \ also works
Warning in install.packages :
package ‘C:/Users/<username>/Downloads/colorspace_2.0-0.zip’ is not available for this version of R
What resolved this for me was including type = "win.binary" in install.packages()'s arguments when installing from the download.
install.packages("C:/Users/<username>/Downloads/colorspace_2.0-0.zip", type = "win.binary")
Having done this, install.packages("colorspace") also succeeds (both in session and after remove.packages("colorspace") and restarting R).
Try to install the color space separately and reload the package inside R studio again .
install.packages('ggplot2')
install.packages('colorspace')
library(ggplot2)
Hope this helps!
Sometimes when the Curl version is not updated, problem with installing the packages happens. For resolving the problem in Linux, you could use the following command to update your Curl to tha last version:
sudo apt-get install libcurl4-openssl-dev libxml2-dev
To me, it started giving this error when I updated all my packages using the available option "Packages" in R studio, it was working well before. After trying a few mentioned solutions in google and failed, I updated my R version and installed the packages, it worked.

Resources