安装Enthought Canopy后安装python模块“rpy2”

时间:2013-04-25 00:01:44

标签: python r rpy2 enthought

我的一些python脚本使用rpy2作为R的接口,它与之前的Enthought EPD python完美配合。

我最近从Enthought安装了Canopy Python。 Python现在不再找到rpy2模块,当我尝试重新安装它时,我收到以下错误:

$ easy_install rpy2

[...]

Processing rpy2-2.3.5.tar.gz
Writing /var/folders/9n/qk8wf11d205b0lrr57wyg7k80000gp/T/easy_install-HIclIh/rpy2-2.3.5/setup.cfg
Running rpy2-2.3.5/setup.py -q bdist_egg --dist-dir /var/folders/9n/qk8wf11d205b0lrr57wyg7k80000gp/T/easy_install-HIclIh/rpy2-2.3.5/egg-dist-tmp-A3O60G
"/Library/Frameworks/R.framework/Resources/bin/R" CMD config --ldflags
/Library/Frameworks/R.framework/Resources/bin/config: line 142: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 143: make: command not found
R was not built as a library
Invalid substring

in string

error: Setup script exited with Problem while running `"/Library/Frameworks/R.framework/Resources/bin/R" CMD config --ldflags`

1 个答案:

答案 0 :(得分:2)

您的错误意味着R未使用--enable-R-shlib构建,或者设置很难找到R.您是否还在此过程中的某处升级/重新安装/重建R?在终端,以下命令的输出是什么:

echo $R_HOME

ls $R_HOME/lib

据推测,第一个显示/Library/Frameworks/R.framework/Resources与rpy安装正在查找的位置相匹配,但是第二个是否有libR.dylib可用?

如果没有,您是否尝试重新安装R?