我正在尝试在python中使用rpy2库。
在下面的代码中,我试图在python脚本中获取一个r文件。
import rpy2.robjects as ro
y=ro.r.source("r file")
我收到以下错误消息。 我正在使用osx yosemite 10.10.4。
anaconda/lib/python2.7/site-packages/rpy2/robjects/robject.py:6: UserWarning: Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/usr/local/Cellar/r/3.2.2_1/R.framework/Versions/3.2/Resources/library/grDevices/libs/grDevices.so':
dlopen(/usr/local/Cellar/r/3.2.2_1/R.framework/Versions/3.2/Resources/library/grDevices/libs/grDevices.so, 6): Symbol not found: __cg_jpeg_resync_to_restart
Referenced from: /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
Expected in: /Users/zopper/anaconda/lib//libJPEG.dylib
in /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
rpy2.rinterface.initr()
/anaconda/lib/python2.7/site-packages/rpy2/robjects/robject.py:6: UserWarning: In addition:
rpy2.rinterface.initr()
/anaconda/lib/python2.7/site-packages/rpy2/robjects/robject.py:6: UserWarning: Warning message:
rpy2.rinterface.initr()
/anaconda/lib/python2.7/site-packages/rpy2/robjects/robject.py:6: UserWarning: package ‘grDevices’ in options("defaultPackages") was not found
rpy2.rinterface.initr()
/anaconda/lib/python2.7/site-packages/rpy2/robjects/robject.py:6: UserWarning: package ‘graphics’ in options("defaultPackages") was not found
rpy2.rinterface.initr()
/anaconda/lib/python2.7/site-packages/rpy2/robjects/robject.py:6: UserWarning: During startup -
rpy2.rinterface.initr()
/anaconda/lib/python2.7/site-packages/rpy2/robjects/robject.py:6: UserWarning: Warning messages:
rpy2.rinterface.initr()
/anaconda/lib/python2.7/site-packages/rpy2/robjects/robject.py:6: UserWarning: 1: package ‘stats’ in options("defaultPackages") was not found
修改
添加
的结果otool -L /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
/System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO:
/System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate (compatibility version 1.0.0, current version 4.0.0)
/System/Library/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics (compatibility version 64.0.0, current version 600.0.0)
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices (compatibility version 1.0.0, current version 48.0.0)
/System/Library/PrivateFrameworks/AppleVPA.framework/Versions/A/AppleVPA (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1153.18.0)
/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 62.0.0)
/System/Library/PrivateFrameworks/AppleJPEG.framework/Versions/A/AppleJPEG (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libJPEG.dylib (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libTIFF.dylib (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libPng.dylib (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libGIF.dylib (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libJP2.dylib (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libRadiance.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)
/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5)
/System/Library/Frameworks/IOSurface.framework/Versions/A/IOSurface (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0)