rpy2/rinterface/_rinterface.so: undefined symbol: rl_basic_word_break_characters

Issue #185 closed
Laure Quintric created an issue

hello, I tried to install rpy2 (v 2.3.9) but the command python -m 'rpy2.tests' fails with the following error message :

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

I used python v2.7.5 and R v3.0.3. R was compiled with readline. I also added libR.so in my LD_LIBRARY_PATH but still getting the error...

Any ideas to solve the issue ? Thanks ! Laure

Comments (15)

  1. Laurent Gautier

    This is usually a symptom that libreadline cannot be linked dynamically when starting rpy2.

    Make sure that libreadline is installed, and can be found (for example by setting LD_LIBRARY_PATH , or using ldconfig).

  2. Laurent Gautier

    No news.

    I am assuming that this was an issue with the local installation and libreadline.

    Closing, reopen if the issue is still present.

  3. zeynepe

    Hi Laurent,

    I think I have libreadline installed AND it is in the path LD_LIBRARY_PATH, and still getting a similar error.

    I have libreadline.so in $HOME/packages/lib. And this folder is in my export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/packages/lib

    When I run ldd $HOME/packages/lib/libreadline.so I get these: linux-vdso.so.1 => (0x00007fffe3bd7000) libc.so.6 => /lib64/libc.so.6 (0x00002b70ffc21000) /lib64/ld-linux-x86-64.so.2 (0x0000003000000000)

    When I run this simple command, below is the error I get:

    from rpy2 import robjects ImportError: /home1/04183/zeynepe/.virtualenvs/forecasting/lib/python2.7/site-packages/rpy2/rinterface/_rinterface.so: undefined symbol: rpy2_isinitialize

    Any ideas?

  4. Laurent Gautier

    Any ideas?

    Yes:

    • What is the version of rpy2 you are using ? import rpy2; print(rpy2.__version__)
    • Did you update R since you last installed rpy2 ?
    • If yes, did you try installing rpy2 ?
    • What does return R --version in a terminal ?
    • What are the first lines in the terminal when running python -m rpy2.tests ?
    • Are the R versions above matching ?
  5. zeynepe
    • rpy2 version 2.8.1
    • I just uninstalled rpy2 and reinstalled it with pip install rpy2.
    • I am using R 3.2.1.
    • I do not think I see any R version listed when I run the tests. This is all I get.

    Traceback (most recent call last): File "/opt/apps/intel15/python/2.7.9/lib/python2.7/runpy.py", line 162, in _run_module_as_main "main", fname, loader, pkg_name) File "/opt/apps/intel15/python/2.7.9/lib/python2.7/runpy.py", line 72, in _run_code exec code in run_globals File "/home1/04183/zeynepe/.virtualenvs/forecasting/lib/python2.7/site-packages/rpy2/tests.py", line 23, in <module> import rpy2.tests_rpy_classic File "/home1/04183/zeynepe/.virtualenvs/forecasting/lib/python2.7/site-packages/rpy2/tests_rpy_classic.py", line 3, in <module> import rpy2.rpy_classic as rpy File "/home1/04183/zeynepe/.virtualenvs/forecasting/lib/python2.7/site-packages/rpy2/rpy_classic.py", line 5, in <module> import rpy2.rinterface as ri File "/home1/04183/zeynepe/.virtualenvs/forecasting/lib/python2.7/site-packages/rpy2/rinterface/init.py", line 92, in <module> from rpy2.rinterface._rinterface import (baseenv, ImportError: /home1/04183/zeynepe/.virtualenvs/forecasting/lib/python2.7/site-packages/rpy2/rinterface/_rinterface.so: undefined symbol: rpy2_isinitialized

  6. zeynepe

    You gave me some ideas, so I installed a local R v3.3.1to the server. Then, I installed rpy2 v2.81 in a virtual env. Now I am getting a similar but different error when I run python -m rpy2.tests: ImportError: /home1/04183/zeynepe/packages/readline/lib/libreadline.so.6: undefined symbol: PC. I just thought maybe this might spark a new recommendation.

  7. Andreas

    I see a similar issue (I think). I am on RHEL 7.2 (Maipo)

    • virtual python 3.5.0 environment
    • I installed rpy2 using pip install rpy2
    • import rpy2; print(rpy2.__version__) yields 2.8.1
    • R --version is 3.1.2
    • python -m rpy2.tests results in the following output:
    Traceback (most recent call last):
      File "/usr/local/lib/python3.5/runpy.py", line 170, in _run_module_as_main
        "__main__", mod_spec)
      File "/usr/local/lib/python3.5/runpy.py", line 85, in _run_code
        exec(code, run_globals)
      File "/home/aleha/local/python_bioinf/lib/python3.5/site-packages/rpy2/tests.py", line 23, in <module>
        import rpy2.tests_rpy_classic
      File "/home/aleha/local/python_bioinf/lib/python3.5/site-packages/rpy2/tests_rpy_classic.py", line 3, in <module>
        import rpy2.rpy_classic as rpy
      File "/home/aleha/local/python_bioinf/lib/python3.5/site-packages/rpy2/rpy_classic.py", line 5, in <module>
        import rpy2.rinterface as ri
      File "/home/aleha/local/python_bioinf/lib/python3.5/site-packages/rpy2/rinterface/__init__.py", line 92, in <module>
        from rpy2.rinterface._rinterface import (baseenv,
    ImportError: /home/aleha/local/python_bioinf/lib/python3.5/site-packages/rpy2/rinterface/_rinterface.cpython-35m-x86_64-linux-gnu.so: undefined symbol: installChar
    

    Any help is highly appreciated!

  8. Laurent Gautier

    @zeynepe : Your R requires a libreadline that is not known to the dynamic linker by default and not in LD_LIBRARY_PATH when in the virtualenv.

  9. Andreas

    I was simply using another R installation than intended. And that version was not compiled with readline support enabled.

  10. Log in to comment