Jacquot Jacquot -4 years ago 285
R Question

Loading rpy2 : ImportError: version `GOMP_4.0' not found

Loading rpy2 on a Jupyter Notebook or in the console brought me the following error :

Traceback (most recent call last):
File "/home/louis/anaconda3/lib/python3.5/runpy.py", line 184, in _run_module_as_main
"__main__", mod_spec)
File "/home/louis/anaconda3/lib/python3.5/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/louis/anaconda3/lib/python3.5/site-packages/rpy2/tests.py", line 23, in <module>
import rpy2.tests_rpy_classic
File "/home/louis/anaconda3/lib/python3.5/site- packages/rpy2/tests_rpy_classic.py", line 3, in <module>
import rpy2.rpy_classic as rpy
File "/home/louis/anaconda3/lib/python3.5/site-packages/rpy2/rpy_classic.py", line 5, in <module>
import rpy2.rinterface as ri
File "/home/louis/anaconda3/lib/python3.5/site-packages/rpy2/rinterface/__init__.py", line 92, in <module>
from rpy2.rinterface._rinterface import (baseenv,
ImportError: /home/louis/anaconda3/lib/libgomp.so.1: version `GOMP_4.0' not found (required by /usr/lib/R/lib/libR.so)



  • R version : 3.2.3

  • Python version : 3.5.2 :: Anaconda custom (64-bit)

  • OS : ubuntu 16.04 LTS 64 bit

  • rpy2 version : 2.8.5



I don't know how relevant it may be, but I have gcc installed, and I can import rpy2 in python.

Any help or hint would be greatly appreciated.




Following omri_saadon's comment, I set
LD_LIBRARY_PATH
to all paths that led to a libgomp directory, which are :


  • $HOME/anaconda3/pkgs/gcc-4.8.5-7/lib

  • $HOME/anaconda3/pkgs/libgcc-4.8.5-2/lib

  • $HOME/anaconda3/pkgs/lib



but each time got the same error :

ImportError: path_to_libgomp/libgomp.so.1: version `GOMP_4.0' not found (required by /usr/lib/R/lib/libR.so)





So my quest goes on ^^ (I must admit I don't really know the ins and outs of what I am doing).

When I succeed in setting
export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu
(found in root mode) I have another kind of error :

import rpy2.rinterface as ri
File "/home/louis/anaconda3/lib/python3.5/site- packages/rpy2/rinterface/__init__.py", line 92, in <module>
from rpy2.rinterface._rinterface import (baseenv,
ImportError: /home/louis/anaconda3/bin/../lib/libreadline.so.6: undefined symbol: PC


and when I then try to import first the
readline
package (as it seems to have worked with some) I get :

import rpy2.rinterface as rinterface
File "/home/louis/anaconda3/lib/python3.5/site-packages/rpy2/rinterface/__init__.py", line 92, in <module>
from rpy2.rinterface._rinterface import (baseenv,
ImportError: /usr/lib/libblas.so.3: undefined symbol: gotoblas

Answer Source

It appears I finally succeeded in installing and using rpy2.

What I did ?

I installed it with the conda package manager, and not pip. With just conda install rpy2, I was done.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download