简体   繁体   English

Rpy2和Python安装障碍

[英]Rpy2 and Python Installation Road-block

I cant seem to install Rpy2 for python. 我似乎无法为Python安装Rpy2。 Initially I ran across the problem where it displayed the following error. 最初,我遇到了显示以下错误的问题。

Tried to guess R's HOME but no R command in the PATH.

But then I followed instructions in the following thread: trouble installing rpy2 on win7 (R 2.12, Python 2.5) 但是随后我按照以下线程中的说明进行操作: 在win7上安装rpy2时遇到麻烦(R 2.12,Python 2.5)

where by I placed and copied all the files in R\\R-2.12.1\\bin\\i386 to the R\\R-2.12.1\\bin and then set my environment path to point to R\\R-2.12.1. 我将R \\ R-2.12.1 \\ bin \\ i386中的所有文件放置并复制到R \\ R-2.12.1 \\ bin中,然后将环境路径设置为指向R \\ R-2.12.1。 Now trying to install it from source again.. 现在尝试再次从源代码安装它。

python setup.py run

I get the same error. 我犯了同样的错误。 If I set the path variable to R\\R-2.12.1\\bin\\ then I get the following error as showed by the person who gave the second answer 如果我将路径变量设置为R \\ R-2.12.1 \\ bin \\,则出现第二个答案的人所显示的以下错误

ValueError: Invalid substring in string

That thread went out of ideas so I thought a year from now if there are new ways to work around this. 这个主意不合时宜,所以我想从现在开始一年后,如果有新的方法可以解决此问题。

EDIT = once 编辑=一次

Thanks in advance 提前致谢

Me too, I had many difficulties getting rpy2 up and running, even after following the crucial link in the answer from lgauthier. 我也是,即使遵循lgauthier答案中的关键链接,也很难启动和运行rpy2。 But, the final help came from one of the replies on that mailing list. 但是,最终的帮助来自该邮件列表中的一封回复。

Summarized, these were the 4 steps needed to get rpy2 up and running on my Windows7 computer: 总结一下,这些是在Windows7计算机上启动并运行rpy2所需的4个步骤:

  1. Install rpy2 from this link: https://bitbucket.org/breisfeld/rpy2_w32_fix/issue/1/binary-installer-for-win32 从以下链接安装rpy2: https ://bitbucket.org/breisfeld/rpy2_w32_fix/issue/1/binary-installer-for-win32
  2. Add C:\\Program Files\\R\\R-2.12.1\\bin\\i386 (the path to R.dll) to the environment variable PATH 将C:\\ Program Files \\ R \\ R-2.12.1 \\ bin \\ i386(R.dll的路径)添加到环境变量PATH
  3. Add an environment variable R_HOME with C:\\Program Files\\R\\R-2.12.1 使用C:\\ Program Files \\ R \\ R-2.12.1添加环境变量R_HOME
  4. Add an environment variable R_USER with your Windows username 使用Windows用户名添加环境变量R_USER

In case you don't know how to add/change environment variables, look eg here: http://www.computerhope.com/issues/ch000549.htm 如果您不知道如何添加/更改环境变量,请在此处查找例如: http : //www.computerhope.com/issues/ch000549.htm

Check the rpy-mailing list on July 18th. 检查7月18日的rpy邮件列表 There is slight progress on the Windows front for rpy2, and people are reporting some success running it. 在Windows上,rpy2的进展很小,人们报告说运行Rpy2取得了一些成功。

I tried four steps above and it works fine. 我尝试了上述四个步骤,但效果很好。 Kudos on Kadee. 在Kadee上的荣誉。

For question with regards to user1234440, I just use easy_install rpy2 and it works just fine. 对于与user1234440有关的问题,我只使用easy_install rpy2,它就可以正常工作。

http://rpy.sourceforge.net/rpy2/doc-2.2/html/overview.html#download http://rpy.sourceforge.net/rpy2/doc-2.2/html/overview.html#download

Make sure you have set_up tools installed. 确保已安装set_up工具。 If you do not know how to do that,check the link below. 如果您不知道该怎么做,请查看下面的链接。

https://pypi.python.org/pypi/setuptools#windows https://pypi.python.org/pypi/setuptools#windows

You can just run ez_setup.py and let it decide for you. 您可以只运行ez_setup.py并让它为您决定。

Then you just follow steps 2 through 4 contributed by Kadee. 然后,您只需按照Kadee贡献的步骤2至4进行操作即可。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM