我已经尝试了我能想到的每个安装方法在我们的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
感谢您的帮助
答案 0 :(得分:7)
请尝试
sudo apt-get install python-rpy2
(或使用您喜欢的任何包装前端),因为包中存在包。
答案 1 :(得分:0)
如果使用
编译R. ./configure --enable-R-shlib
,然后R安装在/usr/local/lib/R
所以你可以为你和root用户
添加这行到.bashrcexport R_HOME=/usr/local/lib/R
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$R_HOME/lib
然后你可以从pip安装或从tarball构建
答案 2 :(得分:0)
正如rpy2 installation on Ubuntu所指出的,有时缺少python-dev(RHEL中的python-devel)可能会导致这些问题。您可以通过
修复 sudo apt-get install python-dev
或
sudo yum install python-devel
或安装python-dev [el]
的其他操作系统特定指令