How to install "mxnet" package in R 4.0.2 - r

Good afternoon. Recently I have encountered the problem with installing "mxnet" package. I have tried several variants of code, but neither of their actually installs this package.
1.
cran <- getOption("repos")
cran["dmlc"] <- "https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/R/CRAN/15"
options(repos = cran)
install.packages("mxnet")
library(mxnet)
And get the error like this:
Error: package or namespace load failed for ‘mxnet’: package ‘mxnet’
was installed before R 4.0.0: please re-install it
install.packages("https://github.com/jeremiedb/mxnet_winbin/raw/master/mxnet.zip", repos = NULL)
Then I type library(mxnet) and get the error message as in p.1.
3.
cran <- getOption("repos")
cran["dmlc"] <- "https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/R/CRAN/23"
options(repos = cran)
library(devtools)
require(devtools)
install_version("DiagrammeR", version = "0.9.0", repos = "http://cran.us.r-project.org")
require(DiagrammeR)
install.packages("mxnet")
library(mxnet)
After executing this code I get the following error:
ERROR: failed to lock directory 'C:/Users/user/Documents/R/win-library/4.0' for modifying
Try removing 'C:/Users/user/Documents/R/win-library/4.0/00LOCK-rlang'
Error: Failed to install 'unknown package' from URL:
(converted from warning) installation of package ‘rlang’ had non-zero exit status
> install.packages("mxnet")
Warning in install.packages :
cannot open URL 'https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/R/CRAN/23/src/contrib/PACKAGES.rds': HTTP status was '404 Not Found'
Warning in install.packages :
cannot open URL 'https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/R/CRAN/23/src/contrib/PACKAGES.gz': HTTP status was '404 Not Found'
Warning in install.packages :
cannot open URL 'https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/R/CRAN/23/src/contrib/PACKAGES': HTTP status was '404 Not Found'
Warning in install.packages :
unable to access index for repository https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/R/CRAN/23/src/contrib:
cannot open URL 'https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/R/CRAN/23/src/contrib/PACKAGES'
Installing package into ‘C:/Users/user/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)
Warning in install.packages :
cannot open URL 'https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/R/CRAN/23/src/contrib/PACKAGES.rds': HTTP status was '404 Not Found'
Warning in install.packages :
cannot open URL 'https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/R/CRAN/23/src/contrib/PACKAGES.gz': HTTP status was '404 Not Found'
Warning in install.packages :
cannot open URL 'https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/R/CRAN/23/src/contrib/PACKAGES': HTTP status was '404 Not Found'
Warning in install.packages :
unable to access index for repository https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/R/CRAN/23/src/contrib:
cannot open 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 R version 4.0.2)
Warning in install.packages :
cannot open URL 'https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/R/CRAN/23/bin/windows/contrib/4.0/PACKAGES.rds': HTTP status was '404 Not Found'
Warning in install.packages :
cannot open URL 'https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/R/CRAN/23/bin/windows/contrib/4.0/PACKAGES.gz': HTTP status was '404 Not Found'
Warning in install.packages :
cannot open URL 'https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/R/CRAN/23/bin/windows/contrib/4.0/PACKAGES': HTTP status was '404 Not Found'
Warning in install.packages :
unable to access index for repository https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/R/CRAN/23/bin/windows/contrib/4.0:
cannot open URL 'https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/R/CRAN/23/bin/windows/contrib/4.0/PACKAGES'
In the end, mxnet package hasn't been installed in RStudio yet.
I have familizrized myself with MXNet package installation in R , but some of the instructions, given there, didn't bring any help. Other coincide with my code.
Could you, please, tell me, how to successfully install this package? What code should I run?
Thank you for your effort.

As there is no prebuilt MXNet binary available for the version of R that you are using, you will need to follow the build from source instructions. Please see https://mxnet.apache.org/versions/1.7.0/get_started/build_from_source
You can follow these instructions but use the 1.8.0rc2 release archive instead of 1.7.0 if you like.
This question is duplicate of R: namespace load failed for ‘mxnet’: package ‘mxnet’ was installed before R 4.0.0: please re-install it but can't be flagged as duplicate as there are no accepted answers.

Related

Can't Install Package "sp"

I am new to geospatial analysis in R as all of my previous experience is in bioinformatics work. I am attempting to install some of the basic geospatial packages, but am having some issues, specifically revolving around installing the package "sp". When attempt I install.packages("sp") I get the following result:
install.packages("sp")
Installing package into ‘C:/Users/LMetz/Documents/R/win-library/4.1’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.1/sp_1.4-7.zip'
Warning in install.packages :
cannot open URL 'https://cran.rstudio.com/bin/windows/contrib/4.1/sp_1.4-7.zip': HTTP status was '404 Not Found'
Error in download.file(url, destfile, method, mode = "wb", ...) :
cannot open URL 'https://cran.rstudio.com/bin/windows/contrib/4.1/sp_1.4-7.zip'
Warning in install.packages :
download of package ‘sp’ failed
It appears that the URL install.packages is trying to access to download the package no longer exists. Does anyone know what I need to do to fix this? Thanks.

Unable to install R package

When I tried to install the package coxphf, the following error appeared.
Please let me know how to solve this:
install.packages("coxphf")
> Installing package into ‘C:/Users/User/R/win-library/3.4’
> (as ‘lib’ is unspecified)
> trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/coxphf_1.12.zip'
Warning in install.packages :
cannot open URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/coxphf_1.12.zip': HTTP status was '404 Not Found'
Error in download.file(url, destfile, method, mode = "wb", ...) :
cannot open URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/coxphf_1.12.zip'
Warning in install.packages :
download of package ‘coxphf’ failed
Looks like the package isn't available on CRAN at that address.
After digging around, I found the package here: https://cran.rstudio.com/bin/windows/contrib/3.4/coxphf_1.13.zip
Download it and follow instructions here:
http://stat.columbia.edu/~gelman/bugsR/alternate_install.html
It's not expected behavior though, I'm not sure what's causing it, but this workaround will do fine for now

I want to use the Corpus function, but I am unable to install the tm package for text mining in R 3.4.2

The error:
Warning in install.packages : cannot open URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/tm_0.7-1.zip': HTTP status was '404 Not Found' Error in download.file(url, destfile, method, mode = "wb", ...) : cannot open URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/tm_0.7-1.zip' Warning in install.packages : download of package ‘tm’ failed
It can happen sometimes. My suggestion is to download the .zip or .tar.gz file from CRAN and install it through the user interface:
Tools -> Install packages -> Install from: "Package Archive File"

Failure to install `mclust` package in R in Windows 10

When I want to install the package mclust, I get the following error:
> install.packages("mclust")
Installing package into ‘C:/Users/hp1/Documents/R/win-library/3.2’
(as ‘lib’ is unspecified)
There is a binary version available but the source version is
later:
binary source needs_compilation
mclust 5.2.3 5.3 TRUE
Do you want to install from sources the package which needs compilation?
y/n: y
installing the source package ‘mclust’
trying URL 'https://cran.rstudio.com/src/contrib/mclust_5.3.tar.gz'
Content type 'application/x-gzip' length 2792962 bytes (2.7 MB)
downloaded 2.7 MB
* installing *source* package 'mclust' ...
** package 'mclust' successfully unpacked and MD5 sums checked
** libs
*** arch - i386
gcc -m32 -I"C:/PROGRA~1/R/R-32~1.3/include" -DNDEBUG -I"d:/RCompile/r-compiling/local/local323/include" -O3 -Wall -std=gnu99 -mtune=core2 -c init.c -o init.o
gfortran -m32 -O3 -mtune=core2 -c mclust.f -o mclust.o
make: gfortran: Command not found
C:/PROGRA~1/R/R-32~1.3/etc/i386/Makeconf:206: recipe for target 'mclust.o' failed
make: *** [mclust.o] Error 127
Warning: running command 'make -f "Makevars" -f "C:/PROGRA~1/R/R-32~1.3/etc/i386/Makeconf" -f "C:/PROGRA~1/R/R-32~1.3/share/make/winshlib.mk" SHLIB="mclust.dll" SHLIB_LIBADD='$(FLIBS)' OBJECTS="init.o mclust.o mclustaddson.o"' had status 2
ERROR: compilation failed for package 'mclust'
* removing 'C:/Users/hp1/Documents/R/win-library/3.2/mclust'
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-32~1.3/bin/x64/R" CMD INSTALL -l "C:\Users\hp1\Documents\R\win-library\3.2" C:\Users\hp1\AppData\Local\Temp\RtmpiAzB7h/downloaded_packages/mclust_5.3.tar.gz' had status 1
Warning in install.packages :
installation of package ‘mclust’ had non-zero exit status
The downloaded source packages are in
‘C:\Users\hp1\AppData\Local\Temp\RtmpiAzB7h\downloaded_packages’
When digging for solutions on how to fix it, I came across this where the OP says in a comment that the issue was arising due to missing llpack and lblas libraries, which they fixed by installing lapackdev and blasdev packages. But when I try to install these packages, I get error. I checked all my 12 repositories and tried again, but same result.
> install.packages("lapackdev")
Installing package into ‘C:/Users/hp1/Documents/R/win-library/3.2’
(as ‘lib’ is unspecified)
Warning in install.packages :
package ‘lapackdev’ is not available (for R version 3.2.3)
> setRepositories(graphics = getOption("menu.graphics"),
+ ind = NULL, addURLs = character())
--- Please select repositories for use in this session ---
1: + CRAN 2: BioC software
3: BioC annotation 4: BioC experiment
5: BioC extra 6: + CRAN (extras)
7: Omegahat 8: R-Forge
9: rforge.net 10: CRAN (extras, https)
11: R-Forge [https] 12: rforge.net [https]
Enter one or more numbers separated by spaces, or an empty line to cancel
1: 1 2 3 4 5 6 7 8 9 10 11 12
> install.packages("lapackdev")
Warning in install.packages :
cannot open URL 'http://www.omegahat.org/R/src/contrib/PACKAGES.gz': HTTP status was '404 Not Found'
Warning in install.packages :
cannot open URL 'http://www.omegahat.org/R/src/contrib/PACKAGES': HTTP status was '404 Not Found'
Warning in install.packages :
unable to access index for repository http://www.omegahat.org/R/src/contrib:
cannot open URL 'http://www.omegahat.org/R/src/contrib/PACKAGES'
Warning in install.packages :
cannot open URL 'https://R-Forge.R-project.org/src/contrib/PACKAGES.gz': HTTP status was '400 Bad Request'
Warning in install.packages :
cannot open URL 'https://R-Forge.R-project.org/src/contrib/PACKAGES': HTTP status was '400 Bad Request'
Warning in install.packages :
unable to access index for repository https://R-Forge.R-project.org/src/contrib:
cannot open URL 'https://R-Forge.R-project.org/src/contrib/PACKAGES'
Installing package into ‘C:/Users/hp1/Documents/R/win-library/3.2’
(as ‘lib’ is unspecified)
Warning in install.packages :
cannot open URL 'http://www.omegahat.org/R/src/contrib/PACKAGES.gz': HTTP status was '404 Not Found'
Warning in install.packages :
cannot open URL 'http://www.omegahat.org/R/src/contrib/PACKAGES': HTTP status was '404 Not Found'
Warning in install.packages :
unable to access index for repository http://www.omegahat.org/R/src/contrib:
cannot open URL 'http://www.omegahat.org/R/src/contrib/PACKAGES'
Warning in install.packages :
cannot open URL 'https://R-Forge.R-project.org/src/contrib/PACKAGES.gz': HTTP status was '400 Bad Request'
Warning in install.packages :
cannot open URL 'https://R-Forge.R-project.org/src/contrib/PACKAGES': HTTP status was '400 Bad Request'
Warning in install.packages :
unable to access index for repository https://R-Forge.R-project.org/src/contrib:
cannot open URL 'https://R-Forge.R-project.org/src/contrib/PACKAGES'
Warning in install.packages :
package ‘lapackdev’ is not available (for R version 3.2.3)
Warning in install.packages :
cannot open URL 'http://www.omegahat.org/R/bin/windows/contrib/3.2/PACKAGES.gz': HTTP status was '404 Not Found'
Warning in install.packages :
cannot open URL 'http://www.omegahat.org/R/bin/windows/contrib/3.2/PACKAGES': HTTP status was '404 Not Found'
Warning in install.packages :
unable to access index for repository http://www.omegahat.org/R/bin/windows/contrib/3.2:
cannot open URL 'http://www.omegahat.org/R/bin/windows/contrib/3.2/PACKAGES'
Warning in install.packages :
cannot open URL 'http://www.rforge.net/bin/windows/contrib/3.2/PACKAGES.gz': HTTP status was '404 Not Found'
Warning in install.packages :
cannot open URL 'http://www.rforge.net/bin/windows/contrib/3.2/PACKAGES': HTTP status was '404 Not Found'
Warning in install.packages :
unable to access index for repository http://www.rforge.net/bin/windows/contrib/3.2:
cannot open URL 'http://www.rforge.net/bin/windows/contrib/3.2/PACKAGES'
Warning in install.packages :
cannot open URL 'https://R-Forge.R-project.org/bin/windows/contrib/3.2/PACKAGES.gz': HTTP status was '400 Bad Request'
Warning in install.packages :
cannot open URL 'https://R-Forge.R-project.org/bin/windows/contrib/3.2/PACKAGES': HTTP status was '400 Bad Request'
Warning in install.packages :
unable to access index for repository https://R-Forge.R-project.org/bin/windows/contrib/3.2:
cannot open URL 'https://R-Forge.R-project.org/bin/windows/contrib/3.2/PACKAGES'
Warning in install.packages :
cannot open URL 'https://www.rforge.net/bin/windows/contrib/3.2/PACKAGES.gz': HTTP status was '404 Not Found'
Warning in install.packages :
cannot open URL 'https://www.rforge.net/bin/windows/contrib/3.2/PACKAGES': HTTP status was '404 Not Found'
Warning in install.packages :
unable to access index for repository https://www.rforge.net/bin/windows/contrib/3.2:
cannot open URL 'https://www.rforge.net/bin/windows/contrib/3.2/PACKAGES'
Same with blasdev:
> install.packages("blasdev")
Warning in install.packages :
cannot open URL 'http://www.omegahat.org/R/src/contrib/PACKAGES.gz': HTTP status was '404 Not Found'
Warning in install.packages :
cannot open URL 'http://www.omegahat.org/R/src/contrib/PACKAGES': HTTP status was '404 Not Found'
Warning in install.packages :
unable to access index for repository http://www.omegahat.org/R/src/contrib:
cannot open URL 'http://www.omegahat.org/R/src/contrib/PACKAGES'
Warning in install.packages :
cannot open URL 'https://R-Forge.R-project.org/src/contrib/PACKAGES.gz': HTTP status was '400 Bad Request'
Warning in install.packages :
cannot open URL 'https://R-Forge.R-project.org/src/contrib/PACKAGES': HTTP status was '400 Bad Request'
Warning in install.packages :
unable to access index for repository https://R-Forge.R-project.org/src/contrib:
cannot open URL 'https://R-Forge.R-project.org/src/contrib/PACKAGES'
Installing package into ‘C:/Users/hp1/Documents/R/win-library/3.2’
(as ‘lib’ is unspecified)
Warning in install.packages :
cannot open URL 'http://www.omegahat.org/R/src/contrib/PACKAGES.gz': HTTP status was '404 Not Found'
Warning in install.packages :
cannot open URL 'http://www.omegahat.org/R/src/contrib/PACKAGES': HTTP status was '404 Not Found'
Warning in install.packages :
unable to access index for repository http://www.omegahat.org/R/src/contrib:
cannot open URL 'http://www.omegahat.org/R/src/contrib/PACKAGES'
Warning in install.packages :
cannot open URL 'https://R-Forge.R-project.org/src/contrib/PACKAGES.gz': HTTP status was '400 Bad Request'
Warning in install.packages :
cannot open URL 'https://R-Forge.R-project.org/src/contrib/PACKAGES': HTTP status was '400 Bad Request'
Warning in install.packages :
unable to access index for repository https://R-Forge.R-project.org/src/contrib:
cannot open URL 'https://R-Forge.R-project.org/src/contrib/PACKAGES'
Warning in install.packages :
package ‘blasdev’ is not available (for R version 3.2.3)
Warning in install.packages :
cannot open URL 'http://www.omegahat.org/R/bin/windows/contrib/3.2/PACKAGES.gz': HTTP status was '404 Not Found'
Warning in install.packages :
cannot open URL 'http://www.omegahat.org/R/bin/windows/contrib/3.2/PACKAGES': HTTP status was '404 Not Found'
Warning in install.packages :
unable to access index for repository http://www.omegahat.org/R/bin/windows/contrib/3.2:
cannot open URL 'http://www.omegahat.org/R/bin/windows/contrib/3.2/PACKAGES'
Warning in install.packages :
cannot open URL 'http://www.rforge.net/bin/windows/contrib/3.2/PACKAGES.gz': HTTP status was '404 Not Found'
Warning in install.packages :
cannot open URL 'http://www.rforge.net/bin/windows/contrib/3.2/PACKAGES': HTTP status was '404 Not Found'
Warning in install.packages :
unable to access index for repository http://www.rforge.net/bin/windows/contrib/3.2:
cannot open URL 'http://www.rforge.net/bin/windows/contrib/3.2/PACKAGES'
Warning in install.packages :
cannot open URL 'https://R-Forge.R-project.org/bin/windows/contrib/3.2/PACKAGES.gz': HTTP status was '400 Bad Request'
Warning in install.packages :
cannot open URL 'https://R-Forge.R-project.org/bin/windows/contrib/3.2/PACKAGES': HTTP status was '400 Bad Request'
Warning in install.packages :
unable to access index for repository https://R-Forge.R-project.org/bin/windows/contrib/3.2:
cannot open URL 'https://R-Forge.R-project.org/bin/windows/contrib/3.2/PACKAGES'
Warning in install.packages :
cannot open URL 'https://www.rforge.net/bin/windows/contrib/3.2/PACKAGES.gz': HTTP status was '404 Not Found'
Warning in install.packages :
cannot open URL 'https://www.rforge.net/bin/windows/contrib/3.2/PACKAGES': HTTP status was '404 Not Found'
Warning in install.packages :
unable to access index for repository https://www.rforge.net/bin/windows/contrib/3.2:
cannot open URL 'https://www.rforge.net/bin/windows/contrib/3.2/PACKAGES'
What is going on and how do I get mclust to install?
I am answering my own question as the following solved the issue (i.e., mclust was installed successfully) without needing to install the 2 packages I mention in the question. So, this might help someone facing difficulty install mclust.
I updated R version from 3.25 to 3.4, and R studio version from 0.9 to the latest (1.0.143 at the time of writing this answer), and this seems to have solved the issue.

Unable to install rgdal package

I have to work with shapefiles and to convert these to rasters the package rgdal is recommended, however the package is not recognized (R v2.11, RStudio 0.98.501, Mac OS X 10_7_5). How could I still install rgdal or omit this package?
To clarify my question more, the error messages are:
> install.packages("rgdal")
Warning in install.packages :
cannot open: HTTP status was '404 Not Found'
Warning in install.packages :
cannot open: HTTP status was '404 Not Found'
Warning in install.packages :
unable to access index for repository http://www.stats.ox.ac.uk/pub/RWin/bin/macosx/leopard/contrib/2.11
Warning in install.packages :
argument 'lib' is missing: using '/Users/myname/Library/R/2.11/library'
Warning in install.packages :
cannot open: HTTP status was '404 Not Found'
Warning in install.packages :
cannot open: HTTP status was '404 Not Found'
Warning in install.packages :
unable to access index for repository http://www.stats.ox.ac.uk/pub/RWin/bin/macosx/leopard/contrib/2.11
Warning in install.packages :
package ‘rgdal’ is not available

Resources