问题描述
我正在尝试构建和安装 rpy2 Python 模块.但出现错误(见下文).
I am trying to build and install rpy2 Python Module. But got an error (see below).
我在 C:\Program Files\R\R-2.15.0\
中安装了 R,Rh
位于 C:\Program Files\R\R-2.15.0\include
.如何告诉 setup.py 在该目录中找到 R 标头?
I have R installed in C:\Program Files\R\R-2.15.0\
and R.h
is in C:\Program Files\R\R-2.15.0\include
. How can I tell setup.py to find the R header in that directory?
Python 和 R 均使用适用于 Windows 64 位的官方二进制文件安装.
Both Python and R were installed using official binary file for Windows 64bit.
有人可以为 Windows 64 位和 Python2.7 64 位贡献一个 rpy2 二进制构建吗?Christoph Gohlke 表示,出于法律或技术原因,rpy2 未包含在他的 Python 扩展包的非官方 Windows 二进制文件中.其他人有成功的打击吗?
Can someone contribute a rpy2 binary build for windows 64bit and Python2.7 64bit? Christoph Gohlke said for legal or technical reasons, rpy2 is not included in his Unofficial Windows Binaries for Python Extension Packages. Anyone else has a successful hit?
谢谢!
鉴于以下过程:
$ python setup.py build
running build
running build_py
running build_ext
returned an empty string. (5 times)
将 R 配置为库:
include_dirs: ()
libraries: ()
library_dirs: ('C:/PROGRA~1/R/R-215~1.0/bin/i386',)
extra_link_args: ()
# OSX-specific (included in extra_link_args)
framework_dirs: ()
frameworks: ()
构建'rpy2.rinterface._rinterface'扩展,使用这个命令:
building 'rpy2.rinterface._rinterface' extension, using this command:
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\amd64\cl.exe /c
/nologo /Ox /MD /W3 /GS- /DNDEBUG -DWin32=1 -DCSTACK_DEFNS=1
-I.\rpy\rinterface -IC:\Python27\include -IC:\Python27\PC
/Tc.\rpy\rinterface\_rinterface.c
/Fobuild\temp.win-amd64-2.7\Release\.\rpy\rinterface\_rinterface.obj
_rinterface.c
给出这个错误:
.\rpy\rinterface\_rinterface.c(61) : fatal error C1083: Cannot open include file:
'R.h': No such file or directory
error: command '"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\amd64\cl.exe"'
failed with exit status 2
推荐答案
这是 rpy2 Windows 二进制文件、所有 Python 版本和 x86/x64 的链接:
Here's a link to the rpy2 Windows binaries, all Python versions and x86/x64:
http://www.lfd.uci.edu/~gohlke/pythonlibs/#rpy2
这篇关于在 Windows7 64 位上为 Python 2.7 安装 rpy2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!