install camtraptor - error in updating cli to 3.6.1

201 views
Skip to first unread message

Mariska Weijerman

unread,
Nov 23, 2023, 6:22:52 AM11/23/23
to agouti...@googlegroups.com
Hi all,

I am having trouble updating the cli file needed to install the camraptor package.

> devtools::source_url("https://raw.githubusercontent.com/MarcusRowcliffe/camtraptor_density_example/main/rem_functions.R")
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : 
  namespace ‘cli’ 3.4.1 is already loaded, but >= 3.6.1 is required

I tried installing the other require packages but then get stuck in a loop that keeps telling me R needs to restart to install packages. when I say yes I get in the loop
> install.packages(c("devtools", "tidyverse", "activity", "Distance"))
Error in install.packages : Updating loaded packages

Restarting R session...

> install.packages(c("devtools", "tidyverse", "activity", "Distance")) 
Error in install.packages : Updating loaded packages

 when I say no it will try to build the packages but I get error messages with updating the cli package. 

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\IARDA\AppData\Local\R\win-library\4.2\00LOCK\cli\libs\x64\cli.dll to C:\Users\IARDA\AppData\Local\R\win-library\4.2\cli\libs\x64\cli.dll: Permission denied

I don't know what to do to resolve this.

Thanks for any suggestions!
Mariska

Damiano Oldoni

unread,
Nov 23, 2023, 8:32:15 AM11/23/23
to agouti-users
Hi Mariska

It is better to update packages in basic R: you run less risks to get into these kind of loops. They are generated by trying to installing packages which are by default installed to support RStudio or packages required to support some data you have in memory.
 
You can try the following:
  1. Close all RStudio sessions
  2. Open basic R (select R 4.2 in case you have more than one R versions. Your RStudio seems to point to that version)
  3. Run update.packages(ask = FALSE, checkBuilt = TRUE) to update ALL packages you have on your machine and their dependencies. I set a reminder in my agenda every month so that I do this regularly.
If you don't want to update all packages, you can try to run install.packages(c("devtools", "tidyverse", "activity", "Distance")). Still, in basic R, not RStudio.

I hope this helps!
Damiano
Reply all
Reply to author
Forward
0 new messages