0

I'm trying to install the R package text2vec, I get the following error. It says it cannot open a certain shared object file.

> install.packages("text2vec")
Error in dyn.load(file, DLLpath = DLLpath, ...) : 
  unable to load shared object '/var/R/library/rsparse/libs/rsparse.so':
  float.so: cannot open shared object file: No such file or directory
Calls: <Anonymous> ... asNamespace -> loadNamespace -> library.dynam -> dyn.load
Execution halted
ERROR: lazy loading failed for package ‘text2vec’
* removing ‘/var/R/library/text2vec’
Warning in install.packages :
  installation of package ‘text2vec’ had non-zero exit status

This is my session info:

R version 4.0.3 (2020-10-10)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Red Hat Enterprise Linux

Matrix products: default
BLAS/LAPACK: /usr/lib64/libopenblasp-r0.3.3.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8    LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] readr_1.4.0        usethis_2.0.1      purrr_0.3.4        rebus_0.1-3        testthat_3.0.3     stringi_1.6.2      scales_1.1.1      
 [8] tictoc_1.0.1       ggplot2_3.3.3      topicmodels_0.2-12 udpipe_0.8.6       tidytext_0.3.1     tidyr_1.1.3        stringr_1.4.0     
[15] dplyr_1.0.5        odbc_1.3.2        

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.6            lubridate_1.7.10      lattice_0.20-41       assertthat_0.2.1      utf8_1.2.1            slam_0.1-48          
 [7] plyr_1.8.6            cellranger_1.1.0      R6_2.5.0              stats4_4.0.3          quanteda_3.1.0        pillar_1.5.1         
[13] cld3_1.4.1            rlang_0.4.10          readxl_1.3.1          rstudioapi_0.13       data.table_1.14.0     blob_1.2.1           
[19] Matrix_1.2-18         rebus.base_0.0-3      config_0.3.1          bit_4.0.4             munsell_0.5.0         compiler_4.0.3       
[25] janeaustenr_0.1.5     xfun_0.24             pkgconfig_2.0.3       tidyselect_1.1.0      tibble_3.1.0          rebus.numbers_0.0-1  
[31] fansi_0.4.2           crayon_1.4.1          dbplyr_2.1.1          withr_2.4.1           SnowballC_0.7.0       grid_4.0.3           
[37] gtable_0.3.0          lifecycle_1.0.0       DBI_1.1.1             magrittr_2.0.1        tokenizers_0.2.1      RcppParallel_5.1.4   
[43] cli_2.4.0             reshape2_1.4.4        fs_1.5.0              NLP_0.2-1             xml2_1.3.2            stopwords_2.2        
[49] ellipsis_0.3.1        generics_0.1.0        vctrs_0.3.7           fastmatch_1.1-3       wordcloud_2.6         RColorBrewer_1.1-2   
[55] tools_4.0.3           bit64_4.0.5           glue_1.4.2            rebus.unicode_0.0-2   hms_1.0.0             rebus.datetimes_0.0-1
[61] parallel_4.0.3        yaml_2.2.1            tm_0.7-8              colorspace_2.0-0      knitr_1.33            modeltools_0.2-23 

Can someone help me?

Nina van Bruggen
  • 393
  • 2
  • 13
  • 2
    Since the actual issue seems to be the rsparse package, try installing it first. You also might want to install without so many packages being loaded. – Roland Aug 30 '21 at 14:50

1 Answers1

2

The problem here is the float package and the way R installs dependencies when not using "staged installs". What you can do here is to first reinstall the float package, and once it is reinstalled, reinstall the rsparse package. If that still doesn't work - and this is specific to float which uses dynamic linking - perhaps try installing float manually, changing the configuration to ensure that it uses your currently installed BLAS library (here openblas).

anymous.asker
  • 1,179
  • 9
  • 14
  • Thank you for your answer :) I have tried reinstalling the packages but unfortunately this does not help. Could you tell me how I can install float manually and change the configuration? – Nina van Bruggen Aug 31 '21 at 14:35
  • 1
    @NinavanBruggen you'd have to edit the configure script: https://github.com/wrathematics/float/blob/66f05784c7c6b81799f57daae9c4413cd9dc18f9/configure.ac#L94 - are you getting any error message from `float`? Strage that it fails like that. Also, are you installing grom CRAN or from some mirror like MRAN? Perhaps you could also check in `rsparse`'s configure script if the arguments it determines for linking to `float` are correct or not: https://github.com/rexyai/rsparse/blob/66df48a72d1f6105f41f0d54088b5538d0217418/configure.ac#L15 – anymous.asker Aug 31 '21 at 17:05
  • Thank you! It's my work environment. I use the package manager and I work on Rstudio Server Pro (which is now called the workbench I think). Earlier on the fact that we use package manager and RHEL7 was the cause of package problems. I also don't have an internet connection on that server because of security reasons. – Nina van Bruggen Sep 01 '21 at 07:31
  • 1
    @NinavanBruggen what do you get from `library(float)`? Also, did it show any error message when installing? – anymous.asker Sep 01 '21 at 10:53
  • No error messages while installing. The problem starts when I load rsparse: > library(rsparse) Error: package or namespace load failed for ‘rsparse’ in dyn.load(file, DLLpath = DLLpath, ...): unable to load shared object '/var/R/library/rsparse/libs/rsparse.so': float.so: cannot open shared object file: No such file or directory In addition: Warning message: package ‘rsparse’ was built under R version 4.0.5 – Nina van Bruggen Sep 01 '21 at 12:16
  • @NinavanBruggen that means you haven't reinstalled `rsparse`, and it also looks like you have parallel R installs and you're mixing packages between them. Perhaps the installation failed and it kept an older version? – anymous.asker Sep 01 '21 at 12:20