简体   繁体   English

rpy2与R的自定义安装一起使用

[英]Usage of rpy2 with a custom installation of R

Dear fellow programmers, I would like to use R inside of a ipython notebook. 亲爱的程序员,我想在ipython笔记本中使用R。 On the system (Centos) I am working on exists an older version of R (2.15). 在我正在使用的系统(Centos)上,存在一个较旧的R(2.15)版本。 I was able to execute R-code with this version in a ipython notebook, however, I need a newer version of R with extra packages and because I don't have administrative right for that machine, I have a local machine on which I installed the newest version of R (3.1.2). 我可以在ipython笔记本中使用此版本执行R代码,但是,我需要带有附加软件包的R新版本,并且由于我对该计算机没有管理权限,因此我安装了本地计算机R的最新版本(3.1.2)。 I compiled the source on my pc and flagged it in a way that it can be assessed by extensions. 我在PC上编译了源代码并对其进行了标记,以便可以通过扩展对其进行评估。 After that I installed rpy2 with pip and this installation went without any errors. 之后,我用pip安装了rpy2,并且此安装没有任何错误。 I also can import the rpy2 package, but when I try to load libraries, I get an error message: 我也可以导入rpy2包,但是当我尝试加载库时,出现错误消息:

Error in dyn.load(file, DLLpath = DLLpath, ...) : 
  unable to load shared object '/my/homedir/Software/R-3.1.2/library/stats/libs/stats.so':
  libRlapack.so: cannot open shared object file: No such file or directory
During startup - Warning message:
package \u2018stats\u2019 in options("defaultPackages") was not found 

I looked it up, all libraries are present and I don't get an error when I use R without ipython. 我查了一下,所有库都存在,当我在没有ipython的情况下使用R时也没有收到错误。 Anyone has ideas? 有人有主意吗?

Best, Daniel 最好,丹尼尔

Have you tried this? 你有尝试过吗? http://www.lfd.uci.edu/~gohlke/pythonlibs/#rpy2 It's very weird when you say you need admin right to update R version because R usually doesn't require admin right to be installed. http://www.lfd.uci.edu/~gohlke/pythonlibs/#rpy2当您说需要管理员权限来更新R版本时,这很奇怪,因为R通常不需要安装管理员权限。 Make sure you install that under your user folder, instead of somewhere in the system drive. 确保将其安装在用户文件夹下,而不是系统驱动器中的某个位置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM