rpy2 3.1.0 fails to install on Python 3.5

Issue #584 duplicate
Scott Gigante created an issue

rpy2 is failing to install on my local machine and on Travis CI (https://travis-ci.com/KrishnaswamyLab/scprep/jobs/235744025) with Python 3.5.

[sag86@farnam1 ~]$ python --version
Python 3.5.1
[sag86@farnam1 ~]$ pip install --user rpy2
Collecting rpy2
  Using cached https://files.pythonhosted.org/packages/85/a3/4948c12c3701b47410ea1bb27508737983d61255fb291a51cebca6460fc8/rpy2-3.1.0.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-sdeeptg4/rpy2/setup.py", line 166
        [f'{pack_name}.{x}'
                          ^
    SyntaxError: invalid syntax

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-sdeeptg4/rpy2

Comments (5)

  1. Laurent Gautier

    Rpy2 is only compatible with Python3, and while setup.py is meant to test and report a meaningful error is was made Python3-only by mistake.

  2. Scott Gigante reporter

    Sorry, maybe I am misunderstanding - isn’t Python 3.5.1 a supported version of Python3?

  3. Laurent Gautier

    This is a guess, but the syntax error does suggest that Python 2 is involved.

    pip -V or pip debug might tell you more about which Python is used with pip on your system.

  4. Scott Gigante reporter

    From the Travis CI link above:

    $ python --version
    Python 3.5.6
    $ pip --version
    pip 18.1 from /home/travis/virtualenv/python3.5.6/lib/python3.5/site-packages/pip (python 3.5)
    $ pip install -U .[test]
    Processing /home/travis/build/KrishnaswamyLab/scprep
    Requirement already satisfied, skipping upgrade: numpy>=1.10.0 in /home/travis/virtualenv/python3.5.6/lib/python3.5/site-packages (from scprep==0.12.3a0) (1.15.4)
    Requirement already satisfied, skipping upgrade: scipy>=0.18.0 in /home/travis/virtualenv/python3.5.6/lib/python3.5/site-packages (from scprep==0.12.3a0) (1.3.1)
    Requirement already satisfied, skipping upgrade: scikit-learn>=0.19.1 in /home/travis/virtualenv/python3.5.6/lib/python3.5/site-packages (from scprep==0.12.3a0) (0.21.3)
    Requirement already satisfied, skipping upgrade: pandas<0.24,>=0.19.0 in /home/travis/virtualenv/python3.5.6/lib/python3.5/site-packages (from scprep==0.12.3a0) (0.23.4)
    Requirement already satisfied, skipping upgrade: decorator>=4.3.0 in /home/travis/virtualenv/python3.5.6/lib/python3.5/site-packages (from scprep==0.12.3a0) (4.4.0)
    Requirement already satisfied, skipping upgrade: nose in /home/travis/virtualenv/python3.5.6/lib/python3.5/site-packages (from scprep==0.12.3a0) (1.3.7)
    Collecting nose2 (from scprep==0.12.3a0)
      Using cached https://files.pythonhosted.org/packages/2a/c6/f1941e6af8e97cb5cf7405283d5240ba3fb0ce9ace68403904436d6fff65/nose2-0.9.1-py2.py3-none-any.whl
    Collecting fcsparser (from scprep==0.12.3a0)
      Using cached https://files.pythonhosted.org/packages/8c/63/902127e11677ac6ffbd462ff63f1adefe91913daf1b9f28c9fe4f26e2251/fcsparser-0.2.0.tar.gz
    Collecting tables (from scprep==0.12.3a0)
      Using cached https://files.pythonhosted.org/packages/dc/99/772573497919ed01a92259bc28b30c9b5d757a161a043680ee09fb726b83/tables-3.5.2-cp35-cp35m-manylinux1_x86_64.whl
    Collecting h5py (from scprep==0.12.3a0)
      Using cached https://files.pythonhosted.org/packages/10/56/d5c53cd170529bb40cd7dd43e2b68944cb65a45f65ab4c78a68f4ac9e51e/h5py-2.10.0-cp35-cp35m-manylinux1_x86_64.whl
    Collecting rpy2>=3.0 (from scprep==0.12.3a0)
      Using cached https://files.pythonhosted.org/packages/85/a3/4948c12c3701b47410ea1bb27508737983d61255fb291a51cebca6460fc8/rpy2-3.1.0.tar.gz
        Complete output from command python setup.py egg_info:
        Traceback (most recent call last):
          File "<string>", line 1, in <module>
          File "/tmp/pip-install-9vitw6w2/rpy2/setup.py", line 166
            [f'{pack_name}.{x}'
                              ^
        SyntaxError: invalid syntax
    
        ----------------------------------------
    Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-9vitw6w2/rpy2/
    The command "pip install -U .[test]" exited with 1.
    

    I don’t think Python 2 is involved. The same on my local computer:

    $ python3 --version
    Python 3.5.2
    $ python3 -m pip --version
    pip 19.2.3 from /usr/local/lib/python3.5/dist-packages/pip (python 3.5)
    $ python3 -m pip install --user rpy2
    Collecting rpy2
      Downloading https://files.pythonhosted.org/packages/85/a3/4948c12c3701b47410ea1bb27508737983d61255fb291a51cebca6460fc8/rpy2-3.1.0.tar.gz (158kB)
         |████████████████████████████████| 163kB 2.7MB/s 
        ERROR: Command errored out with exit status 1:
         command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-wqr1iokw/rpy2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-wqr1iokw/rpy2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base pip-egg-info
             cwd: /tmp/pip-install-wqr1iokw/rpy2/
        Complete output (6 lines):
        Traceback (most recent call last):
          File "<string>", line 1, in <module>
          File "/tmp/pip-install-wqr1iokw/rpy2/setup.py", line 166
            [f'{pack_name}.{x}'
                              ^
        SyntaxError: invalid syntax
        ----------------------------------------
    ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
    

    This PEP seems to indicate f strings were introduced in Python 3.6: https://www.python.org/dev/peps/pep-0498/

  5. Log in to comment