2012-06-28 64 views
0

我已经尝试了所有可以在我们的debian服务器上安装RPy2的安装方法,并且无论如何我都会收到相同的消息。我已经安装并在我的Mac上成功使用它。有什么我可能会失踪?rpy2在debian上的安装问题

开始

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 

感谢您的帮助

回答

6

请尝试

sudo apt-get install python-rpy2 

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

+0

非常感谢您的帮助 – user1340048

+0

其他OS特定的指令好像你是新来的。你问这个人问的问题应该是两件事:如果你喜欢它,可以点击上面的“upvote”答案。如果您喜欢,可以点击标记“接受”答案。你可以做或者两者兼而有之(这对于判断为“好”的答案是很常见的)。 –

0

如果用

./configure --enable-R-shlib编译R,则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安装或从压缩包构建

0

正如rpy2 installation on Ubuntu中指出的,有时会丢失一个python-dev(python-d RHEL中的evel)可能会导致这些问题。您可以通过修复或者

sudo apt-get install python-dev 

sudo yum install python-devel 

或者安装Python-dev的[EL]