安裝R 包 stringr, stringi 報錯及解決方法


加載或者安裝R包 stringr,stringr時報錯如下 libicui18n.so.64 找不到

加載:

library(stringi)
Error: package or namespace load failed for ‘stringi’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/data/home/heshuai/Miniconda3/envs/RV_3.6/lib/R/library/stringi/libs/stringi.so':
libicui18n.so.58: cannot open shared object file: No such file or directory

安裝:

byte-compile and prepare package for lazy loading
Error in dyn.load(file, DLLpath = DLLpath, ...) : 
  unable to load shared object '/data/home/heshuai/Miniconda3/envs/RV_3.6/lib/R/library/stringi/libs/stringi.so':
  libicui18n.so.58: cannot open shared object file: No such file or directory
* installing *source* package ‘stringr’ ...
** package ‘stringr’ successfully unpacked and MD5 sums checked
** using staged installation
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
Error in dyn.load(file, DLLpath = DLLpath, ...) : 
  unable to load shared object '/data/home/heshuai/Miniconda3/envs/RV_3.6/lib/R/library/stringi/libs/stringi.so':
  libicui18n.so.58: cannot open shared object file: No such file or directory
Calls: <Anonymous> ... namespaceImport -> loadNamespace -> library.dynam -> dyn.load
Execution halted
ERROR: lazy loading failed for package ‘stringr’
* removing ‘/data/home/heshuai/Miniconda3/envs/RV_3.6/lib/R/library/stringr’
* restoring previous ‘/data/home/heshuai/Miniconda3/envs/RV_3.6/lib/R/library/stringr’

The downloaded source packages are in
	‘/tmp/RtmpxFZBJi/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning message:
In install.packages("stringr") :
  installation of package ‘stringr’ had non-zero exit status

找了好久才發現是不能使用默認的ICU庫:解決方法如下:

install.packages("stringr", configure.args="--disable-pkg-config")

 

* installing *source* package ‘stringr’ ...
** package ‘stringr’ successfully unpacked and MD5 sums checked
** using staged installation
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
*** copying figures
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (stringr)

The downloaded source packages are in
	‘/tmp/RtmpT9D38H/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done

完美解決

 

 

參考:https://github.com/gagolews/stringi/blob/master/INSTALL; https://github.com/tidyverse/stringr/issues/320

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM