Rpy2安装的坑 KOBAS两周安装历程

编译R ./configure --enable-R-shlib=yes --with-tcltk --prefix=/opt/soft/R-3.3.1/ --with-readline=yes
with-readline千万不要选no,影响RPY2 默认为yes

否则报错undefined symbol: rl_basic_word_break_characters

当然首先要安装 yum install readline-devel

Traceback (most recent call last):
  File "/appli/python/2.7.5_gnu-4.8.0/python-2.7.5/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/appli/python/2.7.5_gnu-4.8.0/python-2.7.5/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/appli/pythonmods/rpy2-2.3.9/build/lib.linux-x86_64-2.7/rpy2/tests.py", line 2, in <module>
    import sys, rpy2.rinterface
  File "/appli/pythonmods/rpy2-2.3.9/build/lib.linux-x86_64-2.7/rpy2/rinterface/__init__.py", line 101, in <module>
    from rpy2.rinterface._rinterface import *
ImportError: /appli/pythonmods/rpy2-2.3.9/build/lib.linux-x86_64-2.7/rpy2/rinterface/_rinterface.so: undefined symbol: rl_basic_word_break_characters

如果找不到R_HOME可以修改代码setup.py

r_home = subprocess.check_output((r_bin, "RHOME"),universal_newlines=True)

改为

r_home = /opt/soft/R-3.3.1

sudo python setup.py build install

你可能感兴趣的:(linux)