Unable to install package "stringi", Error: there is no package called 'stringi' (in R)
Asked Answered
C

1

0

I've been trying to resolve an issue in VS Code, where the R Language Server is unable to load, and produces the following error message:

R Language Server (8931) started
Error: package or namespace load failed for ‘tidyverse’:
 .onAttach failed in attachNamespace() for 'tidyverse', details:
  call: NULL
  error: package or namespace load failed for ‘stringr’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/usr/lib/R/library/stringi/libs/stringi.so':
  libicui18n.so.73: cannot open shared object file: No such file or directory
Execution halted

R Language Server (8931) exited with exit code 1

The following answer indicates the issue may lie with the stringi package. Long story short, I ended up removing the stringi package, and tried reinstalling it, resulting in a similar error message to the one above:

$> install.packages("stringi")

Error: package or namespace load failed for ‘tidyverse’:
 .onAttach failed in attachNamespace() for 'tidyverse', details:
  call: NULL
  error: package or namespace load failed for ‘stringr’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]):
 there is no package called ‘stringi’
Execution halted

The downloaded source packages are in
    ‘/tmp/Rtmpu5V2g7/downloaded_packages’
Warning message:
In install.packages("stringi") :
  installation of package ‘stringi’ had non-zero exit status

I coud use some help understanding the error message and how to resolve the issue.


Update:

I tried installing a different package:

install.packages("fortunes")

This returned in a similar error as the one above, stringi is missing.

I then tried removing tidyverse and stringr and then install tidyverse again, which returned the error message below:

> remove.packages("tidyverse")
> remove.packages("stringr")
> install.packages("tidyverse")

Error in library(tidyverse) : there is no package called ‘tidyverse’
Execution halted
Caricaria answered 17/12, 2023 at 23:39 Comment(3)
Can you install any other package? install.packags("fortunes") say?Apnea
remove tidyverse, ie remove.packages('tidyverse'), remove stringi/stringr, restart kernel/rstudio, install tidyverseConnor
I tried installing fortunes, but it rendered the same error as above. I then removed tidyverse and stringr, and tried reinstalling tidyverse again. Now I get the error: Error in library(tidyverse) : there is no package called ‘tidyverse’ Execution haltedCatechu
C
1

Information from this answer suggests that the problem lies with R trying to load stringi and then tidyverse when these weren't installed correctly.

Running R from terminal with the --vanilla flag and then installing tidyverse resolved the issue:

E.g.
$> sudo R --vanilla
> install.packages("tidyverse")
Caricaria answered 18/12, 2023 at 10:42 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.