Installing python module “rpy2” after installing E

2019-05-04 09:55发布

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

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`

1条回答
劳资没心,怎么记你
2楼-- · 2019-05-04 10:23

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

and

ls $R_HOME/lib

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?

If not, have you tried reinstalling R?

查看更多
登录 后发表回答