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.
Related
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?
I was trying to install.packages("rattle")
but it shows this :
Installing package into ‘/home/shahin/R/x86_64-pc-linux-gnu-library/3.4’
(as ‘lib’ is unspecified)
Warning in install.packages :
package ‘rattle’ is not available (for R version 3.4.4)
I am in ubuntu 18.04. I also tried to install RGtk2 that also shows error. How can i install rattle?
rattle requires R version 3.5.0 or higher.
Update R to the latest version, then you'll be able to install it.
You need to update your R version following these instructions : Ubuntu Packages for R. Pay attention to the Secure APT section.
Please run below commands in order to update your version:
install.packages("installr")
library(installr)
updateR()
This will start the updating process of your R installation by: “finding the latest R version, downloading it, running the installer, deleting the installation file, copy and updating old packages to the new R installation.”
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 am trying to install the CRAN Hmisc package in an R Environment Notebook on IBM Watson Studio. But it repeatedly fails with the following Error:
install.packages('Hmisc')
also installing the dependencies ‘checkmate’, ‘rstudioapi’, ‘Formula’, ‘latticeExtra’, ‘acepack’, ‘gridExtra’, ‘htmlTable’, ‘viridis’
Warning message in install.packages("Hmisc"):
“installation of package ‘viridis’ had non-zero exit status”Warning message in install.packages("Hmisc"):
“installation of package ‘Hmisc’ had non-zero exit status”Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
I tried to separately install the viridis package and that also fails with the same error:
install.packages('viridis')
Warning message in install.packages("viridis"):
“installation of package ‘viridis’ had non-zero exit status”Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
What I did was go down a version of the library using devtools:
require(devtools)
install_version('Hmisc', version = "4.1-0")
Then I installed it again:
install.package('Hmisc')
You can then load the library library('Hmisc') and run sessionInfo() to see that you're running the latest version. It's a workaround and I don't know why it initially doesn't want to install. Perhaps it has something to do with R in DSX using version 3.3.2 and some libraries are missing? I haven't a clue.
In turns out to be an incorrect dependency management on viridis. It has a dependency over viridisLite >= 0.2.0. Latest viridis is expecting an object called cividis which was only added on the latest version of viridisLite > 0.2.0. DSX has viridisLite==0.2.0 already installed. Hence, the install of viridis fails. So basically, explicitly installing a newer version of viridisLite solves the issue.
install.packages(c('viridisLite', 'Hmisc'))
TL;DR - Install latest viridisLite and then install Hmisc
I tried the following code for installation
>install.packages("forecast")
The error occurs like:
ERROR: dependency ‘Rcpp’ is not available for package ‘RcppArmadillo’
* removing ‘/root/R/x86_64-pc-linux-gnu-library/2.14/RcppArmadillo’
ERROR: dependencies ‘Rcpp’, ‘RcppArmadillo’ are not available for package ‘forecast’
* removing ‘/root/R/x86_64-pc-linux-gnu-library/2.14/forecast’
The downloaded packages are in
‘/tmp/RtmpJqQfrh/downloaded_packages’
Warning messages:
1: In install.packages("forecast") :
installation of package ‘RcppArmadillo’ had non-zero exit status
2: In install.packages("forecast") :
installation of package ‘forecast’ had non-zero exit status
Your R version is too old for the current versions of the packages which forecast depends upon.
You can try manually installing an older version of the forecast package by downloading from its Archive/ section on CRAN. A good bet would a version of about the same age as your R installation.
If you upgrade R to a current version, the Rcpp, RcppArmadillo, ... all install fine, and so will the newest version of forecast. As you are on Ubuntu, it is actually extremely easy to get these newer version, just read the README here and add the apt repository information as described.
I resolved my problem as:
First of all I have add the my CRAN to the /etc/apt/sources.list. After that I executed the following command from my terminal
sudo apt-get update
and then
sudo apt-get upgrade
Once the upgradation done successful the in R console give the command
install.packages("forecast")
This has resolved my problem. For details information regarding this you can visit cran.r-project.org/bin/linux/ubuntu.
And I thanks to Dirk Eddelbuettel for his kind suggestions.
If updating CRAN doesn't work, you might be missing gcc-fortran. This is needed for quadprog, which is needed for timeseries which in turn is needed for the CRAN forecast package.
To install the gcc-fortran package on Arch Linux, execute:
# pacman -S gcc-fortran
To install the fortran compiler on Ubuntu, execute:
# apt-get install gfortran