9206e78231a6821631c3e1dd28bace05dab0ca59 breaks compatibility with easy_install-2.7 / setuptools

Issue #305 closed
Andreas Ringlstetter created an issue

As of 9206e78231a6821631c3e1dd28bace05dab0ca59, rpy2 can only be installed by either calling setup.py directly or installing it with pip.

easy_install-2.7 or declaring it as a dependency from another package using setuptools with Python 2.7 fails to expose the r_utils library to the linker.

/usr/bin/ld: cannot find -lr_utils
collect2: ld returned 1 exit status
error: Setup script exited with error: command 'gcc' failed with exit status 1

With setuptools and easy_install-2.7, it also fails to check/install the dependencies 'six' and 'singledispatch'. These dependencies are checked and installed correctly when using pip-2.7.

Python 2.7.3
R version 3.2.2 (2015-08-14) -- "Fire Safety"
Ubuntu Precise 64bit with https://launchpad.net/~marutter/+archive/ubuntu/rrutter
rpy2 2.7.0 installed from pypi

Comments (9)

  1. Andreas Ringlstetter reporter

    Is it intentional that you check for if __name__ == '__main__': in setup.py?

    As far as I know, setup.py should never be aware of the entry point.

    The result is now, that all the dependencies and library declarations are not even evaluated unless pip fakes the entry point for compatibility reasons. Removing that bogus condition restores full compatibility with setuptools and easy_setup.

    This check was introduced in b9a1acf3fa3ed5984cbd95fa8876cf840e9e463a alongside a batch of unrelated changes.

  2. Laurent Gautier

    Hi, thanks for reporting issues.

    It is easier to open one bitbucket issue per actual issue.

    Concerning the first issue (easy_install no longer working), the revision moves some of the C level code out of the Python extension _rinterface.so and into a shared library. That's only an initial step in that direction as it will allow experimentations with cffi or ctypes.

    I just tried easy_install rpy2 and it is working. For reference I have (in a virtualenv):

    $ easy_install --version
    setuptools 12.2
    $ python --version
    Python 3.4.3

    I am tempted to say that the issue is upstream, which is easy_install + legacy Python (2.7).

  3. Laurent Gautier

    Not even. It appears to be working with Python 2.7 as well:

    $ python --version
    Python 2.7.8
    $ easy_install --version
    setuptools 7.0

    or with

    $ easy_install --version
    setuptools 18.3.1
  4. Andreas Ringlstetter reporter
    $ easy_install-2.7 --version
    distribute 0.6.24dev-r0
    $ sudo easy_install-2.7 rpy2

    Ok, that easy_install version is ancient, as it's still using the (deprecated) distribute branch of setuptools.

    It looks as if like the interference is caused by the combination of this old setuptools version and the wrongly checked entry point.

    It does work correctly after upgrading to a recent version of setuptools. Not checking the entry point fixes it as well.

  5. Log in to comment