Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

rpy2 doesn't work - requires libiconv.so.2

I have a relatively fresh installation of anaconda, in which I installed rpy2 using "conda install rpy2". However, when I try running it, I get this error, e.g.:

> /[dir]/anaconda/bin/python -m 'rpy2.tests'
Traceback (most recent call last):
  File "/[dir]/anaconda/lib/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/[dir]/anaconda/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "[dir]/anaconda/lib/python2.7/site-packages/rpy2/tests.py", line 23, in <module>
    import rpy2.tests_rpy_classic
  File "/[dir]/anaconda/lib/python2.7/site-packages/rpy2/tests_rpy_classic.py", line 3, in <module>
    import rpy2.rpy_classic as rpy
  File "/[dir]/anaconda/lib/python2.7/site-packages/rpy2/rpy_classic.py", line 5, in <module>
    import rpy2.rinterface as ri
  File "/[dir]/anaconda/lib/python2.7/site-packages/rpy2/rinterface/__init__.py", line 92, in <module>
    from rpy2.rinterface._rinterface import (baseenv,
ImportError: libiconv.so.2: cannot open shared object file: No such file or directory

What is this libiconv.so.2, and why doesn't it work straight from the box?

like image 693
R S Avatar asked Feb 14 '17 09:02

R S


1 Answers

I think you need to conda install -c r libiconv or perhaps install r-essentials, which contains libiconv.

like image 66
Joffer Avatar answered Nov 15 '22 02:11

Joffer