-->

rpy2安装Debian的问题(rpy2 install problems on debian)

2019-07-30 03:51发布

我想尽方法安装我能想到的我们的debian服务器上安装RPy2也不管我得到了同样的信息。 我已经安装并成功地用它在我的Mac。 有什么我可能会丢失?

开始

Processing rpy2
Running setup.py -q bdist_egg --dist-dir /opt/rpy2/egg-dist-tmp-oft2ko

returned an empty string.


returned an empty string.

Configuration for R as a library:
  include_dirs: ('/usr/share/R/include',)
  libraries: ('R',)
  library_dirs: ('/usr/lib64/R/lib',)
  extra_link_args: ()
 # OSX-specific (included in extra_link_args)
  framework_dirs: ()
  frameworks: ()
warning: no previously-included files matching '*patch*' found anywhere in distribution
warning: no previously-included files matching '*diff*' found anywhere in distribution
warning: no previously-included files matching '.hg' found anywhere in distribution
warning: no files found matching 'MANIFEST

。 。 。

结束

./rpy/rinterface/_rinterface.c:3622: error: ‘embeddedR_isInitialized’ undeclared (first use in this function)
./rpy/rinterface/_rinterface.c:3622: error: ‘Py_False’ undeclared (first use in this function)
./rpy/rinterface/_rinterface.c:3634: error: ‘Py_None’ undeclared (first use in this function)
./rpy/rinterface/_rinterface.c:3635: error: ‘PySexpObject’ has no member named ‘sObj’
./rpy/rinterface/_rinterface.c:3637: error: expected expression before ‘)’ token
./rpy/rinterface/_rinterface.c:3650: error: ‘PySexpObject’ has no member named ‘sObj’
./rpy/rinterface/_rinterface.c:3652: error: expected expression before ‘)’ token
./rpy/rinterface/_rinterface.c:3665: error: ‘PySexpObject’ has no member named ‘sObj’
./rpy/rinterface/_rinterface.c:3667: error: expected expression before ‘)’ token
./rpy/rinterface/_rinterface.c:3680: error: expected expression before ‘)’ token
./rpy/rinterface/_rinterface.c:3694: error: expected expression before ‘)’ token
./rpy/rinterface/_rinterface.c:3705: error: ‘rinterface_unserialize’ undeclared (first use in this function)
./rpy/rinterface/_rinterface.c:3705: warning: implicit declaration of function ‘PyDict_GetItemString’
error: Setup script exited with error: command 'gcc' failed with exit status 1

感谢您的帮助

Answer 1:

请试试

sudo apt-get install python-rpy2

(或者使用你喜欢的任何包装前端)作为分配中存在的包。



Answer 2:

如果您编译R 2与

./configure --enable-R-shlib ,则R被安装在/usr/local/lib/R

所以,你可以添加此行的.bashrc,为您和root用户

export R_HOME=/usr/local/lib/R
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$R_HOME/lib

然后你可以从PIP安装或从压缩包建



Answer 3:

正如指出rpy2安装在Ubuntu上 ,有时会丢失蟒蛇-DEV(蟒蛇-devel的在RHEL)可能会导致这些问题。 您可以通过修复

    sudo apt-get install python-dev

要么

    sudo yum install python-devel

或者安装Python-dev的其他OS特定指令[电子]



文章来源: rpy2 install problems on debian