Namespace error when deploying caret packet in RStudio v4.2.1

I just reloaded RStudio for Windows on my PC (10/3/22) but am getting this error when loading caret package:
Error: package or namespace load failed for ‘caret’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
namespace ‘cli’ 3.3.0 is already loaded, but >= 3.6.1 is required

I've tried to remedy this by

  1. installing: install.packages("cli") and
  2. reinstalling caret using both "install.packages('caret')" and "install.packages("caret", dependencies = c("Depends", "Suggests")"
    but to no avail.

Have others encountered this and found solutions?

I think it all comes to this namespace ‘cli’ 3.3.0 is already loaded, but >= 3.6.1 is required
I think it means you need to manually update cli

Thanks JonesYaniv for weighing in!
Do you know how to update cli? As I mentioned in my post, I tried install.packages("cli") but it wasn't resolved.

Hey, I finally got it to work...there was an update for cli that needed to be installed. Thanks!

1 Like

Came to tell you to update cli package but I see you found the solution by yourself, good job!

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.