rpy2 - 在 Windows 上安装 rpy2 时出错

标签 rpy2

我正在尝试安装 rpy2 包并出现以下错误

C:\python27>easy_install rpy2

Searching for rpy2
Reading http://pypi.python.org/simple/rpy2/
Reading http://rpy.sourceforge.net
Best match: rpy2 2.3.3
Downloading http://pypi.python.org/packages/source/r/rpy2/rpy2-2.3.3.tar.gz#md5=6cd95eb70645577cb53198ef0a32395e
Processing rpy2-2.3.3.tar.gz
Running rpy2-2.3.3\setup.py -q bdist_egg --dist-dir c:\users\chetan~1\appdata\local\temp\easy_install-wfxip9\rpy2-2.3.3\egg-di
st-tmp-rrezfb
"C:\PROGRA~2\R\R-28~1.0\bin\R" CMD config --ldflags
Invalid substring

in string

C:\Python27\lib\site-packages\setuptools\command\easy_install.py:921: RuntimeWarning: tp_compare didn't return -1 or -2 for ex
ception
  raise DistutilsError("Setup script exited with %s" % (v.args[0],))
error: Setup script exited with Problem while running `"C:\PROGRA~2\R\R-28~1.0\bin\R" CMD config --ldflags`

当我尝试 pip 这就是我得到的
c:\Python27\Lib\site-packages\django\bin>pip install rpy2

下载/解压 rpy2
为包 rpy2 运行 setup.py egg_info
"C:\PROGRA~2\R\R-28~1.0\bin\R" CMD config --ldflags
Invalid substring

in string

Problem while running `"C:\PROGRA~2\R\R-28~1.0\bin\R" CMD config --ldflags`

最佳答案

我也花了几天时间...然后我偶然发现了 this thread ,其中给出了一个链接:http://www.lfd.uci.edu/~gohlke/pythonlibs/#rpy2

在此页面上,您可以找到(除其他有用的东西之外)用于 Windows 和不同版本 Python 的 rpy2 的预编译版本。它显然只适用于 R 2.15.3,我没有在其他版本上尝试过。

关于rpy2 - 在 Windows 上安装 rpy2 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15311457/

相关文章:

python - 使用 rpy2 从 Python 调用自定义函数

python - 融化唯一索引的 pandas 数据帧以与 ggplot/rpy2 一起使用

python-3.x - 有没有办法在 rpy2 >= 3.0.0 中从 R 向量、矩阵等返回名称

r - 在 Python 中使用 R 和 Rpy2 : how to ggplot2?

python - Jupyter 笔记本 rpy2 Rmagics : How to set the default plot size?

c# - 有没有人将 rpy2 与 py2exe 一起使用?

python - 在 ubuntu 中安装 rpy2 时出错

python - rpy2代码可以并行运行吗?

Python Pandas 到 R 数据框

r - 使用 rpy2 将 NULL 从 Python 转换为 R