Re: [Rpy] Problem with installing rpy2 to Python3

2012-03-27 Thread Yuanda Zhu
Hi Fangyu, I use Win7, not sure if it works but thanks for the suggestion. Y.Z. On Tue, Mar 27, 2012 at 3:47 PM, Fangyu He wrote: > Dear Yuanda Zhu > > I did never do install rpy2 to Python3, but I got it for Python2.7 easily > with the help of apt-get before. I think that you may try it if y

Re: [Rpy] Problem with installing rpy2 to Python3

2012-03-27 Thread Fangyu He
Dear Yuanda Zhu I did never do install rpy2 to Python3, but I got it for Python2.7 easily with the help of apt-get before. I think that you may try it if your os is ubuntu or its likes. I hope it does work, which doesn't take much time. The following is the code used in terminal. sudo apt

Re: [Rpy] Problem with installing rpy2 to Python3

2012-03-26 Thread Yuanda Zhu
I see. Thank you very much for your help though! Y.Z. On Mon, Mar 26, 2012 at 8:45 PM, Thomas Kluyver wrote: > I guess you'll need to comment out the section where it's called: > https://bitbucket.org/lgautier/rpy2/src/f075a4291e9c/setup.py#cl-151 > > I'll try to have a look at this when I've g

Re: [Rpy] Problem with installing rpy2 to Python3

2012-03-26 Thread Thomas Kluyver
I guess you'll need to comment out the section where it's called: https://bitbucket.org/lgautier/rpy2/src/f075a4291e9c/setup.py#cl-151 I'll try to have a look at this when I've got some spare time, but it might be a Windows specific problem, which I'm less able to debug. Thomas On 26 March 2012

Re: [Rpy] Problem with installing rpy2 to Python3

2012-03-26 Thread Yuanda Zhu
Hi Thomas, Here is the new error message with no if statement: File "G:\Backup\Setup\Python\Packages\rpy2-2.2.5\setup.py", line 187, in get_r version rversion = m.groups()[0] AttributeError: 'NoneType' object has no attribute 'groups' Y.Z. On Mon, Mar 26, 2012 at 8:27 PM, Niek de Klein w

Re: [Rpy] Problem with installing rpy2 to Python3

2012-03-26 Thread Niek de Klein
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] #

Re: [Rpy] Problem with installing rpy2 to Python3

2012-03-26 Thread Yuanda Zhu
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 wrote: > Updated gist. https://gist.github.com

Re: [Rpy] Problem with installing rpy2 to Python3

2012-03-26 Thread Thomas Kluyver
Updated gist. https://gist.github.com/2204230 On 26 March 2012 12:06, Yuanda Zhu 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("WAR

Re: [Rpy] Problem with installing rpy2 to Python3

2012-03-26 Thread Yuanda Zhu
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. Than

Re: [Rpy] Problem with installing rpy2 to Python3

2012-03-26 Thread Thomas Kluyver
On 26 March 2012 10:50, Thomas Kluyver 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 em

Re: [Rpy] Problem with installing rpy2 to Python3

2012-03-26 Thread Thomas Kluyver
I haven't tested this, but it should be something like: r_exec = os.path.join(r_home, 'bin', 'R') # Changed --- import subprocess rp = subprocess.check_output([r_exec, '--version'], stderr=subprocess.STDOUT).splitlines() rversion = rp[0] #Twist if 'R RHOME' spit

Re: [Rpy] Problem with installing rpy2 to Python3

2012-03-25 Thread Yuanda Zhu
Hi Thomas, Please excuse my limited knowledge. I do not quite know how to replace it. Could you please write the full syntax for me? By the way, is this a compatibility problem between Python 3.2.2 and rpy2? Many thanks, Y.Z. On Mon, Mar 26, 2012 at 5:02 AM, Thomas Kluyver wrote: > Hi Yuanda,

Re: [Rpy] Problem with installing rpy2 to Python3

2012-03-25 Thread Thomas Kluyver
Hi Yuanda, You should edit setup.py to use subprocess.check_output() instead of os.popen3(). Note that it's not a direct replacement - popen3 returns a file-like object with a readline method; check_output() returns a string (use s.splitlines() to make a list of lines). For reference, you can see

Re: [Rpy] Problem with installing rpy2 to Python3

2012-03-25 Thread Yuanda Zhu
Hi Thomas, Here is the traceback: Traceback (most recent call last): File "G:\Backup\Setup\Python\Packages\rpy2-2.2.5\setup.py", line 462, in [os.path.join('doc', 'source', 'rpy2_logo.png')])], File "F:\Python32\lib\distutils\core.py", line 148, in setup dist.run_commands() File "F

Re: [Rpy] Problem with installing rpy2 to Python3

2012-03-25 Thread Yuanda Zhu
Hi Niek, Here is the Traceback Traceback (most recent call last): File "G:\Backup\Setup\Python\Packages\rpy2-2.2.5\setup.py", line 462, in [os.path.join('doc', 'source', 'rpy2_logo.png')])], File "F:\Python32\lib\distutils\core.py", line 148, in setup dist.run_commands() File "F:\

Re: [Rpy] Problem with installing rpy2 to Python3

2012-03-25 Thread Thomas Kluyver
On 25 March 2012 20:17, Yuanda Zhu wrote: > AttributeError:'module' object has no attribute 'popen3' Can you post the traceback that goes with this? It's most likely a bug somewhere, as popen3 calls should be replaced using the subprocess module (see http://docs.python.org/library/subprocess.htm

Re: [Rpy] Problem with installing rpy2 to Python3

2012-03-25 Thread Yuanda Zhu
Hi Niek, Actually, after I changed the path of R, the error msg appeared to be *AttributeError:'module' object has no attribute 'popen3'* Do you know how to solve this problem? Many thanks, Y.Z. * *On Sun, Mar 25, 2012 at 7:27 PM, Niek de Klein wrote: > Hi Yuanda, > > I haven't had this problem

Re: [Rpy] Problem with installing rpy2 to Python3

2012-03-25 Thread Yuanda Zhu
Hi Niek, I have tried those, but it seems that the methods in that thread don't work on my situation. Thank you very much, Niek. Y.Z. On Sun, Mar 25, 2012 at 7:27 PM, Niek de Klein wrote: > Hi Yuanda, > > I haven't had this problem myself so I don't know if the solutions given > here: > http:/

Re: [Rpy] Problem with installing rpy2 to Python3

2012-03-25 Thread Niek de Klein
Hi Yuanda, I haven't had this problem myself so I don't know if the solutions given here: http://stackoverflow.com/questions/4924917/trouble-installing-rpy2-on-win7-r-2-12-python-2-5. actually work, but it seems like a solution. Cheers, Niek On Sun, Mar 25, 2012 at 8:47 AM, Yuanda Zhu wrote: