我试图在 R 中安装 stringr 包但失败了。
> install.packages("stringr")
Installing package into ‘.../R/x86_64-pc-linux-gnu-library/3.0’
(as ‘lib’ is unspecified)
also installing the dependency ‘stringi’
trying URL 'http://cran.stat.upd.edu.ph/src/contrib/stringi_0.4-1.tar.gz'
Content type 'application/octet-stream' length 3461563 bytes (3.3 Mb)
opened URL
==================================================
downloaded 3.3 Mb
trying URL 'http://cran.stat.upd.edu.ph/src/contrib/stringr_1.0.0.tar.gz'
Content type 'application/octet-stream' length 34880 bytes (34 Kb)
opened URL
==================================================
downloaded 34 Kb
* installing *source* package ‘stringi’ ...
** package ‘stringi’ successfully unpacked and MD5 sums checked
checking for R_HOME... /usr/lib/R
checking for R... /usr/lib/R/bin/R
checking for gcc... gcc -std=gnu99
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc -std=gnu99 accepts -g... yes
checking for gcc -std=gnu99 option to accept ISO C89... none needed
checking whether we are using the GNU C++ compiler... no
checking whether g++ accepts -g... no
checking for cat... /bin/cat
checking for pkg-config... /usr/bin/pkg-config
checking with pkg-config for ICU4C installed... 52.1
checking for ICU4C >= 50... yes
checking for proper CPPFLAGS, LDFLAGS, and LIBS... done
checking whether we may build a simple ICU-dependent project... no
*** We will build ICU4C from sources
checking how to run the C++ preprocessor... /lib/cpp
configure: error: in `/tmp/RtmpsVXxB7/R.INSTALL4e0d5b4186bb/stringi':
configure: error: C++ preprocessor "/lib/cpp" fails sanity check
See `config.log' for more details
ERROR: configuration failed for package ‘stringi’
* removing ‘/home/xtenit/R/x86_64-pc-linux-gnu-library/3.0/stringi’
* restoring previous ‘/home/xtenit/R/x86_64-pc-linux-gnu-library /3.0/stringi’
Warning in install.packages :
installation of package ‘stringi’ had non-zero exit status
* installing *source* package ‘stringr’ ...
** package ‘stringr’ successfully unpacked and MD5 sums checked
** R
** inst
** preparing package for lazy loading
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
object 'vI' not found
ERROR: lazy loading failed for package ‘stringr’
* removing ‘.../R/x86_64-pc-linux-gnu-library/3.0/stringr’
* restoring previous ‘.../R/x86_64-pc-linux-gnu-library /3.0/stringr’
Warning in install.packages :
installation of package ‘stringr’ had non-zero exit status
The downloaded source packages are in
‘/tmp/RtmpV2oP5k/downloaded_packages’
我试图检查这一点,但我不知道需要做什么如何从存档安装 stringi 库并安装本地 icu52l.zip
我刚刚运行了这段代码,但无济于事。
sudo apt-get install libicu-dev