简体   繁体   中英

Rpy2 and Python Installation Road-block

I cant seem to install Rpy2 for python. 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)

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. 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

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. 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:

  1. Install rpy2 from this link: 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
  3. Add an environment variable R_HOME with C:\\Program Files\\R\\R-2.12.1
  4. Add an environment variable R_USER with your Windows username

In case you don't know how to add/change environment variables, look eg here: http://www.computerhope.com/issues/ch000549.htm

Check the rpy-mailing list on July 18th. There is slight progress on the Windows front for rpy2, and people are reporting some success running it.

I tried four steps above and it works fine. Kudos on Kadee.

For question with regards to user1234440, I just use easy_install rpy2 and it works just fine.

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

Make sure you have set_up tools installed. If you do not know how to do that,check the link below.

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

You can just run ez_setup.py and let it decide for you.

Then you just follow steps 2 through 4 contributed by Kadee.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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