How can I solve my problems with the installation of the text2vec package?

703 views Asked by At

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?

2

There are 2 answers

6
anymous.asker On

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).

0
Melt On

on my case with text2vec ubuntu 22.04 R 4.3.1 the loading problems was fixed by installing libopenblas-dev at the os