0

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

Mary
  • 153
  • 1
  • 2
  • 10
  • Apparently there is no binary available for mxnet and you need to build from source (per https://github.com/apache/incubator-mxnet/issues/18774#issuecomment-665798463) - have you tried following the instructions here: https://mxnet.apache.org/get_started/build_from_source ? (If you're on macOS Big Sur, you may need to follow these instructions in order to successfully build packages: https://stackoverflow.com/a/65334247/12957340) – jared_mamrot Mar 18 '21 at 22:57
  • I did but I get an error installing homebrew. With the line ```/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" ``` I get ```curl: (6) Could not resolve host: raw.githubusercontent.com``` Any idea why that might be? @jared_mamrot – Mary Mar 18 '21 at 23:07
  • I get ```HEAD is now at 1b61d5a56 Merge pull request #10873 from Bo98/shell_commands_cop error: Not a valid ref: refs/remotes/origin/master fatal: ambiguous argument 'refs/remotes/origin/master': unknown revision or path not in the working tree. Use '--' to separate paths from revisions, like this: 'git [...] -- [...]' ``` by running the first line you said, and when I run the second option I get ```mkdir: homebrew: File exists``` @jared_mamrot – Mary Mar 18 '21 at 23:30
  • But if I try to run the other lines outlined in the instructions I again get errors, especially when trying to run ```sudo apt-get install -y r-base-core r-cran-devtools libcairo2-dev libxml2-dev``` it says it does not recognise apt-get @jared_mamrot – Mary Mar 18 '21 at 23:32
  • This stackoverflow answer has a potential solution for installing homebrew: https://stackoverflow.com/a/34514721/12957340 (apparently it is a known issue https://github.com/Homebrew/legacy-homebrew/issues/42631) – jared_mamrot Mar 19 '21 at 04:13

0 Answers0