Hi everyone. I am having an issue with installing package learnr and I really need help:( I am currently using a MacBook with R version 4.0.2, Rstudio 1.3.959.
Ive used the following codes but they equally say that I can't install the package.
- I've updated all the packages by using update.packages()
- I used codes like: install.packages("learnr") / install.packages("learnr",dependencies = TRUE, repos=NULL)
- It also seemed like the package knitr was the main issue because the error returned "there is no package called knitr" so I used the following codes to install package knitr (which also didn't work): install.packages('knitr', dependencies = TRUE) / install.packages("xfun")
- for all questions that ask "Do you want to install from sources the package which needs compilation? (Yes/no/cancel)", I said Yes
An example of the error is the following)
install.packages("learnr")
also installing the dependencies ‘xfun’, ‘knitr’
There are binary versions available but the source versions are later:
binary source needs_compilation
xfun 0.14 0.15 TRUE
knitr 1.28 1.29 FALSE
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
there is no package called ‘knitr’
Do you want to install from sources the package which needs compilation? (Yes/no/cancel) Yes
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.0/learnr_0.10.1.tgz'
Content type 'application/x-gzip' length 1651477 bytes (1.6 MB)
downloaded 1.6 MB
The downloaded binary packages are in
/var/folders/8_/lnj7j3sx03d1mljsvz65mnbw0000gn/T//RtmpoiLuCh/downloaded_packages
installing the source packages ‘xfun’, ‘knitr’
.
.
.
- installing source package ‘xfun’ ...
** package ‘xfun’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
ERROR: compilation failed for package ‘xfun’ - removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/xfun’
- restoring previous ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/xfun’
Warning in install.packages :
installation of package ‘xfun’ had non-zero exit status - installing source package ‘knitr’ ...
** package ‘knitr’ successfully unpacked and MD5 sums checked
** using staged installation
** R
** demo
** inst
** byte-compile and prepare package for lazy loading
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
namespace ‘xfun’ 0.14 is being loaded, but >= 0.15 is required
Calls: ... namespaceImportFrom -> asNamespace -> loadNamespace
Execution halted
ERROR: lazy loading failed for package ‘knitr’ - removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/knitr’
Warning in install.packages :
installation of package ‘knitr’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/8_/lnj7j3sx03d1mljsvz65mnbw0000gn/T/RtmpoiLuCh/downloaded_packages’
library(learnr)
Error: package or namespace load failed for ‘learnr’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
there is no package called ‘knitr’