Try it without the if statement:
r_exec = os.path.join(r_home, 'bin', 'R')
# Changed ---------------------------------------
import subprocess
rp = subprocess.check_output([r_exec, '--version'],
stderr=subprocess.STDOUT).decode('ascii').splitlines()
# removed the if statement
rversion = rp[1]
# End of changed section ------------------------
m = re.match('^R ([^ ]+) ([^ ]+) .+$', rversion)
Niek
On Mon, Mar 26, 2012 at 12:55 PM, Yuanda Zhu <jianjian.i...@gmail.com>wrote:
> Hi Thomas,
>
> I tried your updated code and rpy2 still can't be installed properly. I
> searched on the internet and it can be solved by ignore check rversion. Do
> you know how to do it?
>
> Many thanks,
>
> Y.Z.
>
> On Mon, Mar 26, 2012 at 7:29 PM, Thomas Kluyver <tak...@gmail.com> wrote:
>
>> Updated gist. https://gist.github.com/2204230
>>
>> On 26 March 2012 12:06, Yuanda Zhu <jianjian.i...@gmail.com> wrote:
>> > Hi Thomas,
>> >
>> > Thank you very much for your code. I ran it and it showed that
>> >
>> >
>> > File "G:\Backup\Setup\Python\Packages\rpy2-2.2.5\setup.py", line 183,
>> in
>> > get_rversion
>> > if rversion.startswith("WARNING"):
>> > TypeError: startswith first arg must be bytes or a tuple of bytes, not
>> str
>> >
>> >
>> > Please help.
>> >
>> > Thanks,
>> >
>> > Y.Z.
>> >
>> >
>> > On Mon, Mar 26, 2012 at 5:52 PM, Thomas Kluyver <tak...@gmail.com>
>> wrote:
>> >
>> >>
>> >> On 26 March 2012 10:50, Thomas Kluyver <tak...@gmail.com> wrote:
>> >> > I haven't tested this, but it should be something like:
>> >>
>> >>
>> >> Email formatting mangled that a bit. Here it is in a pastebin:
>> >> https://gist.github.com/2204230
>> >>
>> >> Thomas
>> >>
>> >>
>> >>
>> ------------------------------------------------------------------------------
>> >> This SF email is sponsosred by:
>> >> Try Windows Azure free for 90 days Click Here
>> >> http://p.sf.net/sfu/sfd2d-msazure
>> >> _______________________________________________
>> >> rpy-list mailing list
>> >> rpy-list@lists.sourceforge.net
>> >> https://lists.sourceforge.net/lists/listinfo/rpy-list
>> >>
>> >
>> >
>> >
>> >
>> ------------------------------------------------------------------------------
>> > This SF email is sponsosred by:
>> > Try Windows Azure free for 90 days Click Here
>> > http://p.sf.net/sfu/sfd2d-msazure
>> > _______________________________________________
>> > rpy-list mailing list
>> > rpy-list@lists.sourceforge.net
>> > https://lists.sourceforge.net/lists/listinfo/rpy-list
>> >
>>
>>
>> ------------------------------------------------------------------------------
>> This SF email is sponsosred by:
>> Try Windows Azure free for 90 days Click Here
>> http://p.sf.net/sfu/sfd2d-msazure
>> _______________________________________________
>> rpy-list mailing list
>> rpy-list@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/rpy-list
>>
>
>
>
> ------------------------------------------------------------------------------
> This SF email is sponsosred by:
> Try Windows Azure free for 90 days Click Here
> http://p.sf.net/sfu/sfd2d-msazure
> _______________________________________________
> rpy-list mailing list
> rpy-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rpy-list
>
>
------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list