编程语言
首页 > 编程语言> > 安装Enthought Canopy后安装python模块“rpy2”

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

作者:互联网

我的一些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`

解决方法:

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

echo $R_HOME

ls $R_HOME/lib

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

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

标签:python,r,enthought,rpy2
来源: https://codeday.me/bug/20190703/1370143.html