query about loading of devtools

I want to install seuratData in r
for this i need to install and load devtools
i have installed itbut unable to load it by library.

library(devtools)
Error: package or namespace load failed for ‘devtools’ 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
please guide me

This is asking you to update the cli package, try with this command

install.packages("cli")

If you get any error message while doing so, please post the complete console output you get so we can take a look

I am successful in installing and loading "cli".

install.packages("cli")
library(cli)
but when I installed devtools it is done as shown
[> install.packages("devtools")
Installing package into ‘C:/Users/Ms/AppData/Local/R/win-library/4.2’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.2/devtools_2.4.5.zip'
Content type 'application/zip' length 429234 bytes (419 KB)
downloaded 419 KB

package ‘devtools’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
C:\Users\Ms\AppData\Local\Temp\RtmpmsTXZO\downloaded_packages]

for loading I did

library(devtools)
Error: package or namespace load failed for ‘devtools’ 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

I dont know how to deal with this error of namespace!
kindly guide me.

actually i need SeuratData for my work for this i need all this tools including devtools

But since you get the same error message we can assume you are not successful in updating cli. Can you post the complete console output you get when you run this command?

install.packages("cli")

Close and restart R & RStudio should do it.

install.packages("cli")
Installing package into ‘C:/Users/Ms/AppData/Local/R/win-library/4.2’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.2/cli_3.4.1.zip'
Content type 'application/zip' length 1257239 bytes (1.2 MB)
downloaded 1.2 MB

package ‘cli’ successfully unpacked and MD5 sums checked
Warning in install.packages :
cannot remove prior installation of package ‘cli’
Warning in install.packages :
problem copying C:\Users\Ms\AppData\Local\R\win-library\4.2\00LOCK\cli\libs\x64\cli.dll to C:\Users\Ms\AppData\Local\R\win-library\4.2\cli\libs\x64\cli.dll: Permission denied
Warning in install.packages :
restored ‘cli’

The downloaded binary packages are in
C:\Users\Ms\AppData\Local\Temp\Rtmp0wcq47\downloaded_packages

The update is failing because there is a lock file present, try manually removing that file before updating.

yes i delete the previous version of cli and re-installed it again .
now it worked.
Thank you for your guidance

This topic was automatically closed after 45 days. 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.