安装python模块“rpy2"安装 Enthought Canopy 后 [英] Installing python module "rpy2" after installing Enthought Canopy

查看:47
本文介绍了安装python模块“rpy2"安装 Enthought Canopy 后的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

Some of my python scripts use rpy2 as an interface to R, which worked perfectly with the previous Enthought EPD python.

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

I recently installed Canopy Python from Enthought. Python now no longer finds the rpy2 module, and when I try to reinstall it, I get the following errors:

$ 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?在终端,以下命令的输出是什么:

Your error implies that R was not built with --enable-R-shlib or that the setup is having difficulty finding R. Did you also upgrade/reinstall/rebuild R somewhere in this process? At Terminal what is the output of the following commands:

echo $R_HOME

ls $R_HOME/lib

大概第一个显示/Library/Frameworks/R.framework/Resources 匹配 rpy 安装的位置,但是你有 libR.dylib 在第二个中可用吗?

Presumably the first shows /Library/Frameworks/R.framework/Resources which matches where the rpy install is looking, but do you have libR.dylib available in the second?

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

If not, have you tried reinstalling R?

这篇关于安装python模块“rpy2"安装 Enthought Canopy 后的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆