rpy2安装错误(OSX 10.8,R 3.1)

时间:2014-04-30 05:11:11

标签: rpy2

错误消息是

gcc -bundle -undefined dynamic_lookup -g -arch x86_64 -headerpad_max_install_names -arch x86_64 build/temp.macosx-10.6-x86_64-2.7/./rpy/rinterface/_rinterface.o -L/Library/Frameworks/R.framework/Resources/lib -L/Library/Frameworks/R.framework/Resources/modules -lR -llzma -liconv -licucore -lm -o build/lib.macosx-10.6-x86_64-2.7/rpy2/rinterface/_rinterface.so ld: library not found for -llzma collect2: error: ld returned 1 exit status error: command 'gcc' failed with exit status 1

2 个答案:

答案 0 :(得分:0)

我刚试过rpy2 2.4.0并在OSX 10.8.5上成功安装了R 3.1.0。但是,当我在安装后运行测试时

python -m 'rpy2.tests'

它伴随着一次失败

rpy2 version: 2.4.0
- built against R version: 3-1.0--65387
- running linked to R version: R version 3.1.0 (2014-04-10)
/Users/xxx/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pytz/__init__.py:29: UserWarning: Module rpy2 was already imported from /Users/xxx/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/rpy2-2.4.0-py2.7-macosx-10.6-x86_64.egg/rpy2/__init__.pyc, but /Users/xxx/Downloads/rpy2-2.4.0 is being added to sys.path

from pkg_resources import resource_streamFontconfig error: Cannot load default config file     

Ran 374 tests in 8.728s
OK (skipped=1, expected failures=1)

答案 1 :(得分:0)

我遇到了类似问题并使用了brew版本的R:

  

- 编译失败,错误代码1在/ private / tmp / pip_build_root / rpy2

     

ld:找不到-lR的库

直接从http://www.r-project.org的.pkg安装解决了我的问题。