Windows 8 (Anaconda)上rpy2安装错误
我在Windows 8上安装了最新的Anaconda Python版本,现在想安装rpy2这个包。一开始我遇到了几个问题,不过我都解决了,但现在卡在了一个特定的错误上,下面是我遇到的情况。
我输入的命令是
pip install rpy2
结果出现了以下错误信息:
In file included from .\rpy\rinterface\_rinterface.c:58:0:
.\rpy\rinterface\_rinterface.h:8:15: fatal error: R.h: No such file or
directory
compilation terminated.
error: command 'gcc' failed with exit status 1
有没有什么建议?我的环境中已经包含了R.h的路径。
1 个回答
5
Gohlke博士提供的二进制文件可能是最简单的解决方案。不过,要让这个方法有效,你需要在注册表中更改Python
的安装路径。相关的路径在HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\2.7\InstallPath。你需要把它改成anaconda的Python
作为默认的python
安装。如果你想的话,随时可以改回来。