19

直到最近,当 R 升级后奇怪的事情开始发生时,我一直是 Ubuntu 14.04 上 StatET 的快乐用户。任何与网络操作相关的事情都会失败。例如,我不能再从 CRAN 安装软件包:

> install.packages("Hmisc")
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
--- Please select a CRAN mirror for use in this session ---
Error in url("http://cran.r-project.org/CRAN_mirrors.csv") : 
  internet routines cannot be loaded
In addition: Warning message:
In url("http://cran.r-project.org/CRAN_mirrors.csv") :
  unable to load shared object '/usr/lib/R/modules//internet.so':
  /usr/lib/R/modules//internet.so: symbol curl_multi_wait, version CURL_OPENSSL_3 not defined in file libcurl.so.4 with link time reference

如果我在终端中运行 R,它可以顺利运行:

> install.packages("Hmisc")
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
trying URL 'http://cran.at.r-project.org/src/contrib/Hmisc_3.16-0.tar.gz'
Content type 'application/x-gzip' length 629536 bytes (614 KB)
==================================================
downloaded 614 KB

OpenBLAS : Your OS does not support AVX instructions. OpenBLAS is using Nehalem kernels as a fallback, which may give poorer performance.
* installing *source* package ‘Hmisc’ ...
** package ‘Hmisc’ successfully unpacked and MD5 sums checked
** libs
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c Hmisc.c -o Hmisc.o
gfortran   -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4  -c cidxcn.f -o cidxcn.o
gfortran   -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4  -c cidxcp.f -o cidxcp.o
gfortran   -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4  -c hoeffd.f -o hoeffd.o
gfortran   -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4  -c jacklins.f -o jacklins.o
gfortran   -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4  -c largrec.f -o largrec.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c mChoice.c -o mChoice.o
gfortran   -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4  -c maxempr.f -o maxempr.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c nstr.c -o nstr.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c ranksort.c -o ranksort.o
gfortran   -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4  -c rcorr.f -o rcorr.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c string_box.c -o string_box.o
gfortran   -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4  -c wclosest.f -o wclosest.o
gcc -std=gnu99 -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o Hmisc.so Hmisc.o cidxcn.o cidxcp.o hoeffd.o jacklins.o largrec.o mChoice.o maxempr.o nstr.o ranksort.o rcorr.o string_box.o wclosest.o -lgfortran -lm -lquadmath -L/usr/lib/R/lib -lR
installing to /usr/local/lib/R/site-library/Hmisc/libs
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
OpenBLAS : Your OS does not support AVX instructions. OpenBLAS is using Nehalem kernels as a fallback, which may give poorer performance.
* DONE (Hmisc)

The downloaded source packages are in
    ‘/tmp/RtmpVfRKYi/downloaded_packages’

> sessionInfo()
R version 3.2.1 (2015-06-18)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 14.04.2 LTS

locale:
 [1] LC_CTYPE=en_US.UTF-8          LC_NUMERIC=C                 
 [3] 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      
 [7] LC_PAPER=en_US.UTF-8          LC_NAME=en_US.UTF-8          
 [9] LC_ADDRESS=en_US.UTF-8        LC_TELEPHONE=en_US.UTF-8     
[11] LC_MEASUREMENT=en_US.UTF-8    LC_IDENTIFICATION=en_US.UTF-8

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

other attached packages:
[1] rj_2.0.4-2

loaded via a namespace (and not attached):
[1] tools_3.2.1   rj.gd_2.0.0-1

这里会有什么问题?我怎样才能让它再次工作?

在评论部分根据请求进行编辑:

sessionInfo() R 版本 3.2.1 (2015-06-18) 平台:x86_64-pc-linux-gnu (64-bit) 运行于:Ubuntu 14.04.2 LTS

locale:
 [1] LC_CTYPE=en_US.UTF-8          LC_NUMERIC=C                 
 [3] 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      
 [7] LC_PAPER=en_US.UTF-8          LC_NAME=en_US.UTF-8          
 [9] LC_ADDRESS=en_US.UTF-8        LC_TELEPHONE=en_US.UTF-8     
[11] LC_MEASUREMENT=en_US.UTF-8    LC_IDENTIFICATION=en_US.UTF-8

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

other attached packages:
[1] rj_2.0.4-2

loaded via a namespace (and not attached):
[1] tools_3.2.1   rj.gd_2.0.0-1

> library(Hmisc)
Loading required package: grid
Loading required package: lattice
Loading required package: survival
Loading required package: Formula
Loading required package: ggplot2

Attaching package: ‘Hmisc’

The following objects are masked from ‘package:base’:

    format.pval, round.POSIXt, trunc.POSIXt, units
4

3 回答 3

5

根据问题和评论中给出的信息,问题似乎是由于某种原因LD_LIBRARY_PATH使用 StatET 时不正确。我不知道为什么会这样,并且可能有更好的解决方案来解决这个问题,但您至少应该能够解决它。在.RprofileRprofile.site中添加一行,用于Sys.setenv()将您设置LD_LIBRARY_PATH为合理的内容。根据上面给出的信息,可能看起来像这样:

Sys.setenv(LD_LIBRARY_PATH="/usr/lib/R/lib:/usr/lib/x86_64-linux-gnu:/usr/lib")
于 2015-07-13T21:44:31.323 回答
3

如果变量确实有问题,LD_LIBRARY_PATH那么您可以在 Eclipse 中通过运行->运行配置->环境选项卡为您指定的 R 配置设置它。

statet 中的环境选项卡

您可能还需要检查 R 环境的设置。

statet 中的其他选项卡

于 2015-07-31T16:35:26.067 回答
0

也检查这个建议......

“已修复!我刚刚将以下命令添加到我的 .bash_profile 中,问题已解决。export LD_LIBRARY_PATH=$TOOLS/curl-7.43.0/lib:$LD_LIBRARY_PATH”

或者这些

于 2020-11-07T17:26:46.330 回答