/home/me/lib/pythonlib/lib/python/rpy2/rinterface/__init__.py in <module>()
---> 87 from rpy2.rinterface._rinterface import *
ImportError: libRblas.so: cannot open shared object file: No such file or directory
WARNING: Failure executing file: <experiments/arrangement/test_smacof_arrange.py>
我确认正在调用正确的rpy2模块(我的自定义构建),该模块已针对自定义构建的R版本进行构建。为此,我执行以下操作:
I first Build R-base on ubuntu
wget http://cran.r-project.org/bin/linux/ubuntu/natty/r-base_2.14.2.orig.tar.gz # untar and go to directory # enable-R-shblib flag is needed for rpy2 linking, enable-BLAS-shlib was included # because I hoped to solve the problem, which doesnt change anything however ./configure --enable-R-shlib --enable-BLAS-shlib --prefix=/home/me/lib/R make make install
I then build rpy2 against this R build
wget http://pypi.python.org/packages/source/r/rpy2/rpy2-2.2.6.tar.gz # untar and go to directory # build rpy2, by providing the r-home-lib and r-home flags, and deploy to custom dir python setup.py build --r-home /home/me/lib/R --r-home-lib /home/me/lib/R/lib64/R/lib install --home /home/me/lib/pythonlib
I also have adapted my pythonpath to find modules in /home/me/lib/pythonlib, so the problem isn't there. The python build returns the correct configuration (note that Rblas appears here!)
Configuration for R as a library: include_dirs: ('/home/me/lib/R/lib64/R/include',) libraries: ('R', 'Rblas', 'Rlapack') library_dirs: ('/home/me/lib/R/lib64/R/lib',) extra_link_args: ()
我已经试图追踪错误,但一直没有结果。/home/me/lib/R/lib64/R/lib包含libRblas.so,但有一件事情看起来很奇怪,就是libRblas.so从libR.so没有正确链接,但我不确定这是否会导致错误,也不知道如何修复它。
>> ldd -d libR.so
linux-vdso.so.1 => (0x00007fffcec58000)
libRblas.so => not found
libgfortran.so.3 => /usr/lib/x86_64-linux-gnu/libgfortran.so.3 (0x00007fe63d21d000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fe63cf97000)
...
任何帮助都会受到高度赞赏!
/etc/environment
中,以使其默认启用所有用户。 - PDiracDelta