0

When loading my libraries, the 2 libraries of ggfortify and tidyr are not working.

What I did is as follows :

I updated R to the 4.2.2 version.

I used the update command for all the packages.

I installed again the library cli with dependencies = TRUE as an argument.

The error looks as follows

Error: package or namespace load failed for ‘ggfortify’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
 namespace ‘cli’ 3.3.0 is already loaded, but >= 3.4.0 is required
Anas116
  • 797
  • 2
  • 9
  • 1
    Stop R. Try to start it _without any packages loaded_. (Re-)install `cli`. That should give a recent-enough version to satisfy the versioned dependency you are seeing. – Dirk Eddelbuettel Jan 07 '23 at 23:12
  • You mean by stop to end the session and restart it again ? if that so, I just tried it, and reopened it again and before loading the packages, I reinstalled the `cli` package but still the same problem :( – Anas116 Jan 07 '23 at 23:17
  • 1
    The point is to make _really sure_ you are not already attaching packages via a saved session etc. Open R, do `search()` and you should only see base packages. _If you see `cli` in that list you have problem._ This issue is known and common (hence closed as duplicate). One good fix is to frequently run `update.packages()` to keep things current. – Dirk Eddelbuettel Jan 07 '23 at 23:21
  • search() [1] ".GlobalEnv" "tools:rstudio" "package:stats" [4] "package:graphics" "package:grDevices" "package:utils" [7] "package:datasets" "package:methods" "Autoloads" [10] "package:base" – Anas116 Jan 07 '23 at 23:24
  • That's how it appears. So there is a problem right ? – Anas116 Jan 07 '23 at 23:24
  • 1
    I’m wondering if your Autoloads includes packages that are not being listed ? Also run `sessionInfo()` and see if that shows the cli package and it’s version. – IRTFM Jan 07 '23 at 23:29
  • yes exactly it includes it when using `sessioninfo()` – Anas116 Jan 07 '23 at 23:31
  • I got it work. I removed the package and then redownload it thank you two so much – Anas116 Jan 07 '23 at 23:38

0 Answers0