I am having issues installing packages to my working directory.
I am trying to install the AER package.
I have set my working directory and checked it using getwd(). When I install the AER package, using install.packages("AER"), I get the option to choose 'Yes' or 'No', I then choose 'Yes', which shows this message:
Installing package into '/Users/tusharshahahni/Desktop'
(as 'lib' is unspecified)
also installing the dependencies 'cli', 'rlang', 'lifecycle', 'scales', 'car'
There are binary versions available but the source versions are later:
binary source needs_compilation
cli 3.2.0 3.4.1 TRUE
rlang 1.0.2 1.0.6 TRUE
lifecycle 1.0.1 1.0.3 FALSE
scales 1.1.1 1.2.1 FALSE
car 3.0-12 3.1-1 FALSE
AER 1.2-9 1.2-10 FALSE
Do you want to install from sources the packages which need compilation? (Yes/no/cancel)
Followed by this warning:
Warning in install.packages :
installation of package 'AER' had non-zero exit status
The downloaded source packages are in
'/private/var/folders/cn/jsnjzyx54bjfk71l87vx9v800000gn/T/RtmpCKKBby/downloaded_packages'
This is what comes after I install the package. After this I am unable to access the package using library(AER).
Can someone tell me how to solve this?
Related
I've been trying to install DESeq2 via bioconductor. however when i try do download anything via bioconductor I get an error:
Bioconductor version 3.16 (BiocManager 1.30.19), R 4.2.2 (2022-10-31 ucrt)
Warning: package(s) not installed when version(s) same as or greater than current; use `force = TRUE` to re-install:
'DESeq2'Installation paths not writeable, unable to update packages
path: C:/Program Files/R/R-4.2.2/library
packages:
boot, class, codetools, foreign, MASS, Matrix, nlme, spatial, survival
Old packages: 'DelayedArray', 'utf8', 'xfun'
Update all/some/none? \[a/s/n\]:
using 'force = TRUE' doesn't get me anywhere.
I think i need to update the 'DelayedArray', 'utf8', 'xfun' packages. Since I receive:
binary source needs_compilation
DelayedArray 0.23.2 0.24.0 TRUE
utf8 1.2.2 1.2.3 TRUE
xfun 0.36 0.37 TRUE
However, when I then say i want to update all, by typing 'a'. I get the following message:
Warning: installation of package ‘utf8’ had non-zero exit status\*
same thing for xfun.
Does anyone know how to fix this problem?
I do have to add that when then it goes to update the xfun and utf8 package, i do click 'no' when the pop up shows that asks whether i want to install packages from sources the packages which need compilation. i've also tried clicking yes to this question. the error that it then gives when i say no is:
package ‘utf8’ successfully unpacked and MD5 sums checked
Warning: cannot remove prior installation of package ‘utf8’Warning: problem copying C:\Users\famvi\AppData\Local\R\win-library\4.2\00LOCK\utf8\libs\x64\utf8.dll to C:\Users\famvi\AppData\Local\R\win-library\4.2\utf8\libs\x64\utf8.dll: Permission deniedWarning: restored ‘utf8’package ‘xfun’ successfully unpacked and MD5 sums checked
Warning: cannot remove prior installation of package ‘xfun’Warning: problem copying C:\Users\famvi\AppData\Local\R\win-library\4.2\00LOCK\xfun\libs\x64\xfun.dll to C:\Users\famvi\AppData\Local\R\win-library\4.2\xfun\libs\x64\xfun.dll: Permission deniedWarning: restored ‘xfun’
The downloaded binary packages are in
C:\Users\famvi\AppData\Local\Temp\RtmpG86c1M\downloaded_packages
I get this error whenever I try to install any package with jupyter notebook
There is a binary version available but the source version is later:
binary source needs_compilation
Rcpp 1.0.6 1.0.8 TRUE
installing the source package 'Rcpp'
Warning message in install.packages("Rcpp"):
"installation of package 'Rcpp' had non-zero exit status"
For this specific package, I was able to install it with conda install but some packages like lifecontingencies doesen't work and I get this message with install.packages('lifecontingencies')
also installing the dependencies 'Rcpp', 'markovchain'
There are binary versions available but the source versions are later:
binary source needs_compilation
Rcpp 1.0.6 1.0.8 TRUE
markovchain 0.8.5-4 0.8.6 TRUE
lifecontingencies 1.3.7 1.3.8 TRUE
installing the source packages 'Rcpp', 'markovchain', 'lifecontingencies'
Warning message in install.packages("lifecontingencies"):
"installation of package 'Rcpp' had non-zero exit status"Warning message in install.packages("lifecontingencies"):
"installation of package 'markovchain' had non-zero exit status"Warning message in install.packages("lifecontingencies"):
"installation of package 'lifecontingencies' had non-zero exit status"
And I get this with Conda
Is there a way to fix the install.packages command in jupyter notebook ?
My R version is 3.6.1 (2019-07-05)
The CRAN package lifedependencies is now available through Conda Forge.1 I generally recommend that all Conda R environments should source packages from Conda, otherwise one is likely to encounter compilation (really, library linking) issues.
conda install -c conda-forge r-lifedependencies
However, note that this is only available for R 4.0 and 4.1 at this time. If an R 3.6 version truly is required, then please request it by filing an Issue on the feedstock.
For future reference, there are some details on adding CRAN packages to Conda Forge in this answer.
[1]: Note that R packages are typically prefixed with r- in the Conda ecosystem.
Goal
I would like to install devtools to my version of R version 3.5.1.
Problem
When I install the package devtools, I get the following error:
here are binary versions available but the source versions are later:
binary source needs_compilation
processx 3.4.2 3.4.5 TRUE
callr 3.4.3 3.5.1 FALSE
covr 3.5.0 3.5.1 TRUE
ellipsis 0.3.0 0.3.1 TRUE
jsonlite 1.6.1 1.7.2 TRUE
pkgbuild 1.0.6 1.2.0 FALSE
pkgload 1.0.2 1.1.0 TRUE
rlang 0.4.5 0.4.10 TRUE
roxygen2 7.1.0 7.1.1 TRUE
devtools 2.3.0 2.3.2 FALSE
....
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
namespace 'processx' 3.4.2 is being loaded, but >= 3.4.4 is required
ERROR: lazy loading failed for package 'callr'
* removing 'C:/Users/User/AppData/Local/R/win-library/3.5/callr'
In R CMD INSTALL
Warning in install.packages :
installation of package ‘callr’ had non-zero exit status
ERROR: dependency 'callr' is not available for package 'pkgbuild'
* removing 'C:/Users/User/AppData/Local/R/win-library/3.5/pkgbuild'
In R CMD INSTALL
Warning in install.packages :
installation of package ‘pkgbuild’ had non-zero exit status
ERROR: dependencies 'callr', 'pkgbuild' are not available for package 'devtools'
* removing 'C:/Users/User/AppData/Local/R/win-library/3.5/devtools'
In R CMD INSTALL
Warning in install.packages :
installation of package ‘devtools’ had non-zero exit status
Attempted Solution
I tried to install processx 3.4.2 directly by downloading the package into my library from https://github.com/r-lib/processx/releases/tag/v3.4.2.
install.packages(paste0(folder, "processx-3.4.2.tar.gz"), repos = NULL)
Yet, I got the following error message:
Warning in untar2(tarfile, files, list, exdir, restore_times) :
failed to copy 'processx-3.4.2/inst/CODE_OF_CONDUCT.md' to 'processx-3.4.2/CODE_OF_CONDUCT.md'
Warning in untar2(tarfile, files, list, exdir, restore_times) :
skipping pax global extended headers
* installing *source* package 'processx' ...
** libs
*** arch - i386
Warning in system(cmd) : 'make' not found
ERROR: compilation failed for package 'processx'
* removing 'C:/Users/User/AppData/Local/R/win-library/3.5/processx'
In R CMD INSTALL
Warning in install.packages :
installation of package ‘C:/Users/User/AppData/Local/R/win-library/3.5/processx-3.4.2.tar.gz’ had non-zero exit status
Your simplest fix is to either:
Install a newer version of R (!!recommended!!)
Use a snapshot mirror such as the ones from provided by microsoft at https://mran.microsoft.com/snapshots/{date} (replacing {date}) as the mirror argument in install.packages. By looking at https://cran.r-project.org/bin/windows/base/old/ we can see that R-3.5.1 was replaced by R-3.5.2 in december 2018. So I would suggest using 2018-11-31 as your snapshot mirror.
install.packages('devtools', mirror = 'https://mran.microsoft.com/snapshots/2018-11-31')
Some installed packages might "screw up the installation" (too recent versions?) so if the installation or some code fails after installation, I would suggest using renv and R projects (in Rstudio). This would ensure all packages are installed in a fresh environment and that there should be no version conflict (as they will all be installed from the specific snapshot). Reading introduction guides for renv and the Rstudio support for projects can help with this (in case you observe further problems).
It might also be sufficient to uninstall the packages (but it might break some other dependencies).
I am trying to set up a packrat project but it keeps failing because one of the packages (installed from GitHub) depends on a package that doesn't currently have a binary version on CRAN. This is the error message I receive:
> remotes::install_github("BroVic/raampGBV")
Downloading GitHub repo BroVic/raampGBV#master
Skipping 1 packages not available: naijR
Installing 114 packages: DBI, RSQLite, ...
Installing packages into ‘C:/Users/Admn/project/packrat/lib/x86_64-w64-mingw32/3.6.2’
(as ‘lib’ is unspecified)
package ‘naijR’ is available as a source package but not as a binary
There are binary versions available (and will be
installed) but the source versions are later:
binary source
digest 0.6.23 0.6.24
stringi 1.4.4 1.4.5
callr 3.4.1 3.4.2
ps 1.3.0 1.3.1
Error: Failed to install 'raampGBV' from GitHub:
(converted from warning) package ‘naijR’ is not available (as a binary package for R version 3.6.2)
Again, to be clear, raampGBV exists only on GitHub (it's a project-specific package) while naijR is on CRAN. When I try to install raampGBV on its own, the naijR source package is downloaded and installed from CRAN without any issue. But when attempted via packrat, it fails.
According to NEWS for R 3.6.2:
For a Windows or Mac OS X binary package install, install.packages()
will check if a source package is available on the same repositories,
and report if it is a later version or there is a source package but
no binary package available. This check can be suppressed: see the
help page.
Upon examining the Binary packages section of ?install.packages(), it is evident that the type parameter is what is used to control the behaviour referred to in the quote above. The default argument for type in install.packages is getOption("pkgType"), which in my case returned "win.binary". This is how the issue was fixed:
oldOpt <- getOption("pkgType")
options(pkgType = "both")
remotes::install_github("BroVic/raampGBV")
options(pkgType = oldOpt)
The dependencies are now properly installed in the packrat library.
I try in R to install the CRAN-packages "rio" but receive the following error:
install.packages("rio", dependencies = TRUE)
Installing package into ‘C:/software/Rpackages’
(as ‘lib’ is unspecified)
also installing the dependency ‘feather’
There is a binary version available but the source
version is later:
binary source needs_compilation
rio 0.4.0 0.4.8 FALSE
Package which is only available in source form, and may
need compilation of C/C++/Fortran: ‘feather’
These will not be installed
installing the source package ‘rio’
trying URL 'https://cran.rstudio.com/src/contrib/rio_0.4.8.tar.gz'
Content type 'application/x-gzip' length 40366 bytes (39 KB)
downloaded 39 KB
ERROR: dependency 'feather' is not available for package 'rio'
* removing 'C:/software/Rpackages/rio'
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-32~1.4RE/bin/x64/R" CMD INSTALL -l "C:\software\Rpackages" C:\Users\BJRNAU~1\AppData\Local\Temp\Rtmp6rf71B/downloaded_packages/rio_0.4.8.tar.gz' had status 1
Warning in install.packages :
installation of package ‘rio’ had non-zero exit status
The downloaded source packages are in
‘C:\Users\BjørnAugust\AppData\Local\Temp\Rtmp6rf71B\downloaded_packages’
Can anyone help me install the packages?
This was an unintended consequence of importing feather in the latest release of rio. It will be correctly soon in the next release of rio to CRAN (v0.4.11), which should be available by 10 August 2016. In the meantime, you have a couple of options.
1) Install the development version from GitHub using something like:
devtools::install_github("leeper/rio")
# or
remotes::install_github("leeper/rio")
This version (v0.4.11) makes feather optional, so it is installable on older Windows versions.
2) Install an older version of rio:
packageurl <- "https://cran.r-project.org/src/contrib/Archive/rio/rio_0.4.6.tar.gz"
install.packages(packageurl, repos=NULL, type="source")
But note that this will potentially require manual install of package dependencies.
3) Upgrade to the latest version of R (v3.3.1) so that you can install feather (and thus rio).