Yet another error I encounter whilst running DBT2 tests. This time it was a problem with generating the final reports.

They are generated using a Python library which uses R under the hood. This is the error.

Traceback (most recent call last):
  File "/usr/local/bin/dbt2-post-process", line 14, in
    import rpy2.robjects as robjects
  File "/usr/local/lib64/python2.7/site-packages/rpy2/robjects/ __init__.py", line 15, in
    import rpy2.rinterface as rinterface
  File "/usr/local/lib64/python2.7/site-packages/rpy2/rinterface/ __init__.py", line 101, in
    from rpy2.rinterface._rinterface import *
ImportError: libR.so: cannot open shared object file: No such file or directory

To resolve this first locate libR.so.

find /usr -name libR.so

Then add this to your LD_LIBRARY_PATH variable.

export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/lib64/R/lib