0

I am trying to install the 'mapview' package in R. I tried restarting R, clearing the environment, terminating all the sessions, and restarting and with a totally new session.But I keep getting same error message:

Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) : 
  namespace ‘terra’ 1.4-11 is being loaded, but >= 1.5.12 is required
Calls: <Anonymous> ... namespaceImport -> loadNamespace -> namespaceImport -> loadNamespace
Execution halted
ERROR: lazy loading failed for package ‘mapview’
* removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/mapview’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/mapview’
Warning in install.packages :
  installation of package ‘mapview’ had non-zero exit status

The downloaded source packages are in
    ‘/private/var/folders/hc/5lcwxt3j5xg0bnng9j68qms00000gn/T/RtmpUa3EvN/downloaded_packages’
Phil
  • 7,287
  • 3
  • 36
  • 66
  • 1
    Hello. The error is telling you that the problem is with the version installation of the `terra` package, that is probably a dependency of `mapview`. Try to install `terra` before installing `mapview` to see if it brings any error. – rdornas Jul 02 '22 at 11:33

1 Answers1

1

The error Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) : namespace ‘≪package≫’ ≪versionX≫ is being loaded, but >= ≪versionY≫ is required means that the package ≪package≫ ís present but outdated, and can therefore not be loaded successfully.

Updating CRAN packages in R

You can update the package terra by reinstalling it:

install.packages('terra')

Or slightly more interactive with:

update.packages(oldPkgs='terra')

Or in RStudio through Tools > Check for Package Updates...

Update all CRAN packages

You can update all your packages with:

update.packages()

Or through RStudio as mentioned above.

Caspar V.
  • 1,782
  • 1
  • 3
  • 16