rpy2不起作用 - 需要libiconv.so.2

时间:2017-02-14 09:17:32

标签: python anaconda rpy2 libiconv

我有一个相对新鲜的anaconda安装,我使用“conda install rpy2”安装了rpy2。但是,当我尝试运行它时,我收到了这个错误,例如:

> /[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

这是什么libiconv.so.2,为什么它不能直接从框中工作?

1 个答案:

答案 0 :(得分:9)

我认为你需要conda install -c r libiconv或者安装r-essentials,其中包含libiconv。