unable to install RUGARCH package

Hi,
I am trying to download the rugarch package. I am getting the error message mentioned below.
Please help

Thanks in advance.

> install.packages("rugarch")
also installing the dependency ‘ks’


  There is a binary version available but the source version is later:
   binary source needs_compilation
ks 1.13.4 1.13.5              TRUE

Do you want to install from sources the package which needs compilation? (Yes/no/cancel) YES
trying URL 'https://cran.rstudio.com/bin/macosx/big-sur-arm64/contrib/4.1/rugarch_1.4-8.tgz'
Content type 'application/x-gzip' length 5286072 bytes (5.0 MB)
==================================================
downloaded 5.0 MB


The downloaded binary packages are in
	/var/folders/5y/4fj07j053wx4sh7f0jnby3mw0000gn/T//RtmpKLQHc8/downloaded_packages
installing the source package ‘ks’

trying URL 'https://cran.rstudio.com/src/contrib/ks_1.13.5.tar.gz'
Content type 'application/x-gzip' length 1032859 bytes (1008 KB)
==================================================
downloaded 1008 KB

* installing *source* package ‘ks’ ...
** package ‘ks’ 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 ‘ks’
* removing ‘/Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/ks’
Warning in install.packages :
  installation of package ‘ks’ had non-zero exit status

The downloaded source packages are in
	‘/private/var/folders/5y/4fj07j053wx4sh7f0jnby3mw0000gn/T/RtmpKLQHc8/downloaded_packages’

> library(rugarch)
Error: package or namespace load failed for ‘rugarch’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
 there is no package called ‘ks’

> install.packages("ks")

  There is a binary version available but the source version is later:
   binary source needs_compilation
ks 1.13.4 1.13.5              TRUE

Do you want to install from sources the package which needs compilation? (Yes/no/cancel) Yes
installing the source package ‘ks’

trying URL 'https://cran.rstudio.com/src/contrib/ks_1.13.5.tar.gz'
Content type 'application/x-gzip' length 1032859 bytes (1008 KB)
==================================================
downloaded 1008 KB

* installing *source* package ‘ks’ ...
** package ‘ks’ 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 ‘ks’
* removing ‘/Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/ks’
Warning in install.packages :
  installation of package ‘ks’ had non-zero exit status

The downloaded source packages are in
	‘/private/var/folders/5y/4fj07j053wx4sh7f0jnby3mw0000gn/T/RtmpKLQHc8/downloaded_packages’

> library(ks)
Error in library(ks) : there is no package called ‘ks’
> library(rugarch)
Error: package or namespace load failed for ‘rugarch’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
 there is no package called ‘ks’

The easiest solution would be to answer "no" to this question, you would get a precompiled binary version that is a little older but much easier to install.
If you need to install the latest version from source, then you need to install Xcode in your system (not in R) and the recommended development tools for macOS systems.
https://cran.r-project.org/bin/macosx/tools/

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.