How to install and use rpy2 on Ubuntu
Question: I am trying to use Python to call R through rpy2. I am working on Ubuntu
15.10. I have installed Python 3.5.1 as part of Anaconda 2.4.1 (64bit), R and
rpy2 version 2.7.6. When I tried $ python -m 'rpy2.tests' on the terminal, I
am getting the following error:

    
    
    Traceback (most recent call last):
      File "/home/thirsty/anaconda3/lib/python3.5/runpy.py", line 170, in    _run_module_as_main
        "__main__", mod_spec)
      File "/home/thirsty/anaconda3/lib/python3.5/runpy.py", line 85, in _run_code
        exec(code, run_globals)
      File "/home/thirsty/anaconda3/lib/python3.5/site-packages/rpy2/tests.py",   line 23, in <module>
        import rpy2.tests_rpy_classic
      File "/home/thirsty/anaconda3/lib/python3.5/site-packages/rpy2/tests_rpy_classic.py", line 3, in <module>
        import rpy2.rpy_classic as rpy
      File "/home/thirsty/anaconda3/lib/python3.5/site-packages/rpy2/rpy_classic.py", line 5, in <module>
        import rpy2.rinterface as ri
      File "/home/thirsty/anaconda3/lib/python3.5/site-packages/rpy2/rinterface/__init__.py", line 99, in <module>
        from rpy2.rinterface._rinterface import *
    ImportError: /home/thirsty/anaconda3/bin/../lib/libreadline.so.6: undefined symbol: PC
    


Answer: I have resolved the issue. The versions of python, rpy2 are fine. Probably the
command $ python -m 'rpy2.tests' may not be right way of testing rpy2. After
starting python shell, when I typed import rpy2.robjects as robjects it worked
without any errors and I was able to read files using R.

