problems building rpy2 (hg repository) on centos 6.4 running python 3.4.1

Issue #203 wontfix
epifanio
created an issue

Hi,

trying to build rpy2 from repository i got this log :

running install
running build
running build_py
running build_ext
Traceback (most recent call last):
  File "setup.py", line 463, in <module>
    'rpy2': ['doc/source/rpy2_logo.png', ]}
  File "/home/epi/Envs/env1/lib/python3.4/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/home/epi/Envs/env1/lib/python3.4/distutils/dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "/home/epi/Envs/env1/lib/python3.4/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/home/epi/Envs/env1/lib/python3.4/distutils/command/install.py", line 554, in run
    self.run_command('build')
  File "/home/epi/Envs/env1/lib/python3.4/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/home/epi/Envs/env1/lib/python3.4/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/home/epi/Envs/env1/lib/python3.4/distutils/command/build.py", line 126, in run
    self.run_command(cmd_name)
  File "/home/epi/Envs/env1/lib/python3.4/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/home/epi/Envs/env1/lib/python3.4/distutils/dist.py", line 973, in run_command
    cmd_obj.ensure_finalized()
  File "/home/epi/Envs/env1/lib/python3.4/distutils/cmd.py", line 107, in ensure_finalized
    self.finalize_options()
  File "setup.py", line 121, in finalize_options
    rversion = get_rversion(r_home)
  File "setup.py", line 177, in get_rversion
    if rversion.startswith(b"WARNING"):
TypeError: startswith first arg must be str or a tuple of str, not bytes

while trying the "pip3 install rpy2" i got :

https://gist.github.com/anonymous/27362e633a8e0cef5e75

thanks for help!

Comments (18)

  1. Laurent Gautier

    Which branch are you trying to build from ?
    default is hopelessly broken (not ideal, I hope get this back on track soon).

    At the moment, version_2.4.x is what you want:

    hg update version_2.4.x
    
  2. Laurent Gautier

    I looked at and it is choking on things like

    PyObject *key = PyLong_FromVoidPtr((void *)object);
    

    because is it mixing declarations and code.

    I would recommend you to use a C compiler that accept C99... which leads me to the question: what version of gcc are you using ?

  3. epifanio reporter

    Thanks Laurent for the hints. Unfortunately on the machine where rpy has to be installed i do not have root so i had to build gcc from src and then rebuild all the software i was building with the old GCC.
    I can confirm that rpy build fine on centos using gcc 4.9.

  4. Laurent Gautier

    Ouch.
    This is a Python 3.4 thing, it seems. I have (finally) installed it and I am experiencing the same problem with gcc 4.8.1.

    I could set the flag -std=c99 in setup.py, but I am unsure this is playing well with other C compilers (most notably, clang... may be icc as well ?)

    In meantime, the workaround for me is:

    export CFLAGS="-std=c99"; pip install rpy2
    

    edit: This was with Python 3.4.0. Working with Python 3.4.1.

  5. Laurent Gautier

    There is a bug report of the change in Python 3.4, along with a patch:

    http://bugs.python.org/issue21121

    The comments say that the patch landed too late for 3.4.1, and my understanding is that it will be included in Python 3.4.2 (given the massive annoyance that this is, and the number of packages this is breaking, I hope that 3.4.2 will be released soon)

  6. ferdy wallinx

    Hi Laurent,

    I've just been trying to install Rpy2-2.4.4 with python 3.4.2 with pycharm IDE from the repository https://pypi.python.org/pypi. Still I got the error

    mp\rpy2\setup.py", line 168, in get_rversion

    if rversion.startswith("WARNING"):
    

    TypeError: startswith first arg must be bytes or a tuple of bytes, not str

    Are you sure the problem is fixed?

  7. Laurent Gautier

    Ah, yes. 2 problems in one issue report: 1 one of the problems gets solved, the issue gets closed. I am unable to reproduce the issue

    if rversion.startswith("WARNING"):
    

    Are you on Windows ?

  8. Log in to comment