安装rpy2时遇到错误:尝试猜测R的家,但是路径中没有R命令

时间:2021-03-16 23:16:08

I've seen a lot of posts here and elsewhere about this error, but none of the proposed solutions appear to be relevant. I'm on Python 2.7.9, I have an R executable in my path, and I'm trying to install it on an RHEL server not on Windows.

我在这里和其他地方看到过很多关于这个错误的文章,但是没有一个提议的解决方案看起来是相关的。我使用的是Python 2.7.9,路径中有一个R可执行文件,我试图将它安装在RHEL服务器上而不是Windows上。

Here's the specific error I'm seeing. Does anybody have any idea what would be causing it or how to fix it? Thanks!

这是我看到的具体错误。有人知道是什么引起的吗?谢谢!

$ pip install rpy2
Downloading/unpacking rpy2
  Downloading rpy2-2.5.6.tar.gz (165kB): 165kB downloaded
  Running setup.py (path:/tmp/pip_build_my520/rpy2/setup.py) egg_info for package rpy2
    Error: Tried to guess R's HOME but no R command in the PATH.
    Complete output from command python setup.py egg_info:
    Error: Tried to guess R's HOME but no R command in the PATH.

1 个解决方案

#1


11  

Download the rpy2‑2.7.5‑cp35‑none‑win_amd64.whl file from Christoph Gohlke's Python Extension Packages for Windows repository here. Using the command line, change to the download folder and run:

下载rpy2 2.7.5——cp35 - - win_amd64。来自Christoph Gohlke的Windows存储库的Python扩展包的whl文件。使用命令行,切换到下载文件夹并运行:

pip install rpy2‑2.5.5‑cp34‑none‑win_amd64.whl

This should solve the R directory issue and rpy2 should install nicely. All credit to MattDMo.

这应该可以解决R目录问题,rpy2应该可以很好地安装。所有信贷MattDMo。

#1


11  

Download the rpy2‑2.7.5‑cp35‑none‑win_amd64.whl file from Christoph Gohlke's Python Extension Packages for Windows repository here. Using the command line, change to the download folder and run:

下载rpy2 2.7.5——cp35 - - win_amd64。来自Christoph Gohlke的Windows存储库的Python扩展包的whl文件。使用命令行,切换到下载文件夹并运行:

pip install rpy2‑2.5.5‑cp34‑none‑win_amd64.whl

This should solve the R directory issue and rpy2 should install nicely. All credit to MattDMo.

这应该可以解决R目录问题,rpy2应该可以很好地安装。所有信贷MattDMo。