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 the current code here: https://bitbucket.org/lgautier/rpy2/src/f075a4291e9c/setup.py#cl-185 Thomas On 25 March 2012 21:54, Yuanda Zhu <jianjian.i...@gmail.com> wrote: > 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 > <module> > [os.path.join('doc', 'source', 'rpy2_logo.png')])], > File "F:\Python32\lib\distutils\core.py", line 148, in setup > dist.run_commands() > File "F:\Python32\lib\distutils\dist.py", line 917, in run_commands > self.run_command(cmd) > File "F:\Python32\lib\distutils\dist.py", line 936, in run_command > cmd_obj.run() > File "F:\Python32\lib\distutils\command\install.py", line 569, in run > self.run_command('build') > File "F:\Python32\lib\distutils\cmd.py", line 313, in run_command > self.distribution.run_command(command) > File "F:\Python32\lib\distutils\dist.py", line 936, in run_command > cmd_obj.run() > File "F:\Python32\lib\distutils\command\build.py", line 126, in run > self.run_command(cmd_name) > File "F:\Python32\lib\distutils\cmd.py", line 313, in run_command > self.distribution.run_command(command) > File "F:\Python32\lib\distutils\dist.py", line 935, in run_command > cmd_obj.ensure_finalized() > File "F:\Python32\lib\distutils\cmd.py", line 107, in ensure_finalized > self.finalize_options() > File "G:\Backup\Setup\Python\Packages\rpy2-2.2.5\setup.py", line 144, in > finalize_options > rversion = get_rversion(r_home) > File "G:\Backup\Setup\Python\Packages\rpy2-2.2.5\setup.py", line 180, in > get_rversion > rp = os.popen3('"'+r_exec+'" --version')[2] > AttributeError: 'module' object has no attribute 'popen3' > > Please help me, thank you very much > > Y.Z. > > On Mon, Mar 26, 2012 at 4:24 AM, Yuanda Zhu <jianjian.i...@gmail.com> wrote: >> >> 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 >> <module> >> [os.path.join('doc', 'source', 'rpy2_logo.png')])], >> File "F:\Python32\lib\distutils\core.py", line 148, in setup >> dist.run_commands() >> File "F:\Python32\lib\distutils\dist.py", line 917, in run_commands >> self.run_command(cmd) >> File "F:\Python32\lib\distutils\dist.py", line 936, in run_command >> cmd_obj.run() >> File "F:\Python32\lib\distutils\command\install.py", line 569, in run >> self.run_command('build') >> File "F:\Python32\lib\distutils\cmd.py", line 313, in run_command >> self.distribution.run_command(command) >> File "F:\Python32\lib\distutils\dist.py", line 936, in run_command >> cmd_obj.run() >> File "F:\Python32\lib\distutils\command\build.py", line 126, in run >> self.run_command(cmd_name) >> File "F:\Python32\lib\distutils\cmd.py", line 313, in run_command >> self.distribution.run_command(command) >> File "F:\Python32\lib\distutils\dist.py", line 935, in run_command >> cmd_obj.ensure_finalized() >> File "F:\Python32\lib\distutils\cmd.py", line 107, in ensure_finalized >> self.finalize_options() >> File "G:\Backup\Setup\Python\Packages\rpy2-2.2.5\setup.py", line 144, in >> finalize_options >> rversion = get_rversion(r_home) >> File "G:\Backup\Setup\Python\Packages\rpy2-2.2.5\setup.py", line 180, in >> get_rversion >> rp = os.popen3('"'+r_exec+'" --version')[2] >> >> AttributeError: 'module' object has no attribute 'popen3' >> >> >> Please help me fix this, many thanks. >> >> Y.Z. >> >> >> On Mon, Mar 26, 2012 at 3:59 AM, Thomas Kluyver <tak...@gmail.com> wrote: >>> >>> On 25 March 2012 20:17, Yuanda Zhu <jianjian.i...@gmail.com> 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.html#replacing-os-popen-os-popen2-os-popen3). >>> >>> Thanks, >>> 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