Package load Error: Error: package or namespace load failed for ‘tidyverse’: - error: lazy-load database '/usr/local/lib/R/site-library/cli/R/sysdata.rdb' is corrupt

Hey, I am new to R and am getting this error. I would deeply appreciate if anyone can help me.

library(tidyverse)
library(StatsBombR)
library(dplyr)
library(ggplot2)

Warning message in base::nchar(wide_chars$test, type = "width"):
“restarting interrupted promise evaluation”
Warning message in base::nchar(wide_chars$test, type = "width"):
“internal error -3 in R_decompress1”
Error: package or namespace load failed for ‘tidyverse’:
 .onAttach failed in attachNamespace() for 'tidyverse', details:
  call: base::nchar(wide_chars$test, type = "width")
  error: lazy-load database '/usr/local/lib/R/site-library/cli/R/sysdata.rdb' is corrupt
Traceback:

1. library(tidyverse)
2. tryCatch({
 .     attr(package, "LibPath") <- which.lib.loc
 .     ns <- loadNamespace(package, lib.loc)
 .     env <- attachNamespace(ns, pos = pos, deps, exclude, include.only)
 . }, error = function(e) {
 .     P <- if (!is.null(cc <- conditionCall(e))) 
 .         paste(" in", deparse(cc)[1L])
 .     else ""
 .     msg <- gettextf("package or namespace load failed for %s%s:\n %s", 
 .         sQuote(package), P, conditionMessage(e))
 .     if (logical.return) 
 .         message(paste("Error:", msg), domain = NA)
 .     else stop(msg, call. = FALSE, domain = NA)
 . })
3. tryCatchList(expr, classes, parentenv, handlers)
4. tryCatchOne(expr, names, parentenv, handlers[[1L]])
5. value[[3L]](cond)
6. stop(msg, call. = FALSE, domain = NA)

Try reinstalling the cli package

install.packages("cli")

Do you get any error messages while doing so?

1 Like

Thanks @andresrcs for replying ,I tried the code you gave me but it also shows the same error.

install.packages("devtools")
install.packages("remotes")
remotes::install_version("SDMTools","1.1-221")
devtools::install_github("statsbomb/StatsBombR", force = TRUE)

Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)

Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)

Downloading package from url: http://cran.rstudio.com//src/contrib/Archive/SDMTools/SDMTools_1.1-221.tar.gz

R.utils (2.10.1 -> 2.11.0) [CRAN]
Installing 1 packages: R.utils

Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)

Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)

Downloading GitHub repo statsbomb/StatsBombR@HEAD

rlang      (0.4.11   -> 1.0.2   ) [CRAN]
magrittr   (2.0.1    -> 2.0.2   ) [CRAN]
fansi      (0.5.0    -> 1.0.2   ) [CRAN]
crayon     (1.4.1    -> 1.5.0   ) [CRAN]
cli        (3.0.1    -> 3.2.0   ) [CRAN]
pillar     (1.6.3    -> 1.7.0   ) [CRAN]
tidyselect (1.1.1    -> 1.1.2   ) [CRAN]
tibble     (3.1.5    -> 3.1.6   ) [CRAN]
glue       (1.4.2    -> 1.6.2   ) [CRAN]
generics   (0.1.0    -> 0.1.2   ) [CRAN]
iterators  (1.0.13   -> 1.0.14  ) [CRAN]
stringi    (1.7.5    -> 1.7.6   ) [CRAN]
openssl    (1.4.5    -> 2.0.0   ) [CRAN]
jsonlite   (1.7.2    -> 1.8.0   ) [CRAN]
cpp11      (0.4.0    -> 0.4.2   ) [CRAN]
dplyr      (1.0.7    -> 1.0.8   ) [CRAN]
foreach    (1.5.1    -> 1.5.2   ) [CRAN]
xml2       (1.3.2    -> 1.3.3   ) [CRAN]
tidyr      (1.1.4    -> 1.2.0   ) [CRAN]
sp         (1.4-5    -> 1.4-6   ) [CRAN]
doParallel (1.0.16   -> 1.0.17  ) [CRAN]
RCurl      (1.98-1.3 -> 1.98-1.6) [CRAN]
rvest      (1.0.0    -> 1.0.2   ) [CRAN]
Installing 23 packages: rlang, magrittr, fansi, crayon, cli, pillar, tidyselect, tibble, glue, generics, iterators, stringi, openssl, jsonlite, cpp11, dplyr, foreach, xml2, tidyr, sp, doParallel, RCurl, rvest

Installing packages into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)

Warning message in i.p(...):
“installation of package ‘rlang’ had non-zero exit status”
Warning message in i.p(...):
“installation of package ‘magrittr’ had non-zero exit status”
Warning message in i.p(...):
“installation of package ‘fansi’ had non-zero exit status”
Warning message in i.p(...):
“installation of package ‘crayon’ had non-zero exit status”
Warning message in i.p(...):
“installation of package ‘glue’ had non-zero exit status”
Warning message in i.p(...):
“installation of package ‘generics’ had non-zero exit status”
Warning message in i.p(...):
“installation of package ‘jsonlite’ had non-zero exit status”
Warning message in i.p(...):
“installation of package ‘tidyselect’ had non-zero exit status”
Warning message in i.p(...):
“installation of package ‘pillar’ had non-zero exit status”
Warning message in i.p(...):
“installation of package ‘tibble’ had non-zero exit status”
Warning message in i.p(...):
“installation of package ‘dplyr’ had non-zero exit status”
✔  checking for file ‘/tmp/RtmpGC7V1j/remotesf542eaf35/statsbomb-StatsBombR-9db8298/DESCRIPTION’
─  preparing ‘StatsBombR’:
✔  checking DESCRIPTION meta-information
─  checking for LF line-endings in source and make files and shell scripts
─  checking for empty or unneeded directories
─  building ‘StatsBombR_0.1.0.tar.gz’
   

Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)

install.packages("cli")
library(tidyverse)
library(StatsBombR)
library(dplyr)
library(ggplot2)
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)

also installing the dependency ‘glue’


Warning message in install.packages("cli"):
“installation of package ‘glue’ had non-zero exit status”
Warning message in base::nchar(wide_chars$test, type = "width"):
“restarting interrupted promise evaluation”
Warning message in base::nchar(wide_chars$test, type = "width"):
“internal error -3 in R_decompress1”
Error: package or namespace load failed for ‘tidyverse’:
 .onAttach failed in attachNamespace() for 'tidyverse', details:
  call: base::nchar(wide_chars$test, type = "width")
  error: lazy-load database '/usr/local/lib/R/site-library/cli/R/sysdata.rdb' is corrupt
Traceback:

1. library(tidyverse)
2. tryCatch({
 .     attr(package, "LibPath") <- which.lib.loc
 .     ns <- loadNamespace(package, lib.loc)
 .     env <- attachNamespace(ns, pos = pos, deps, exclude, include.only)
 . }, error = function(e) {
 .     P <- if (!is.null(cc <- conditionCall(e))) 
 .         paste(" in", deparse(cc)[1L])
 .     else ""
 .     msg <- gettextf("package or namespace load failed for %s%s:\n %s", 
 .         sQuote(package), P, conditionMessage(e))
 .     if (logical.return) 
 .         message(paste("Error:", msg), domain = NA)
 .     else stop(msg, call. = FALSE, domain = NA)
 . })
3. tryCatchList(expr, classes, parentenv, handlers)
4. tryCatchOne(expr, names, parentenv, handlers[[1L]])
5. value[[3L]](cond)
6. stop(msg, call. = FALSE, domain = NA)

I'll suggest you try one thing at a time, andresrcs asked you to run one command and provide all the output.
I see that you included that command, but amongst many others which potentially makes it harder to read.
That said, before we install cli, lets try again to install glue
Could you please restart your R session / open it clean
and then

install.packages("glue")

and share us the output from that ?

your problem is solved or not

This topic was automatically closed 21 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.