R-无法在Python 2.7中安装RPY2



我试图在捆绑在Mac OS X Sierra(10.12.6)的Python环境(2.7.x)中安装RPy2,因此,我正在尝试安装最新的非2.9.x版本来自终端的 pip通过命令:

pip install 'rpy2<2.9.0' --user

--user标志之所以存在,是因为我已经在通常不是管理员的用户上安装了自制型号,并且我为此短暂地打开了管理权,以安装自制的唯一目的。

每次运行此命令时,都会收到以下错误:

Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/1x/d_trx3556sl61by_tp4093j80000gq/T/pip-build-uV52fY/rpy2/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/1x/d_trx3556sl61by_tp4093j80000gq/T/pip-LoW5FN-record/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /private/var/folders/1x/d_trx3556sl61by_tp4093j80000gq/T/pip-build-uV52fY/rpy2/

回顾输出,它在失败时显示以下内容:

creating build/temp.macosx-10.12-intel-2.7/rpy/rinterface
/usr/local/Cellar/gcc/7.2.0/bin/gcc-7 -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -I./rpy/rinterface -I/Library/Frameworks/R.framework/Resources/include -c ./rpy/rinterface/r_utils.c -o build/temp.macosx-10.12-intel-2.7/./rpy/rinterface/r_utils.o
unable to execute '/usr/local/Cellar/gcc/7.2.0/bin/gcc-7': No such file or directory
error: command '/usr/local/Cellar/gcc/7.2.0/bin/gcc-7' failed with exit status 1

我找不到任何遇到类似错误的人,我无法弄清楚发生了什么。有人知道为什么这会失败吗?

我会阻止您在系统的python中安装Python软件包(除非您对"突然停止工作"而对重新安装系统感到满意)。

>

我还鼓励您使用最新的RPY2(2.9.x系列可以说比2.8.x系列要好得多),然后转到Python3。

最后,OS X上的RPY2-2.9.3的二进制轮现在可以在PYPI上使用(使安装不再需要开发工具)。

最新更新