Python3.3 linux: ImportError: cannot import name help

Issue #116 resolved
Former user created an issue

I've been trying the latest release and default in the repo with python 3.3 on a Linux machine. (ubuntu 12.10 with latest py3.3 from source). It installs fine however it errors on importing rpy2.robject.

``` #!python

Python 3.3.0 (default, Feb 4 2013, 17:24:07) [GCC 4.7.2] on linux Type "help", "copyright", "credits" or "license" for more information.

import rpy2 import rpy2.robjects Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/opt/python3/lib/python3.3/site-packages/rpy2/robjects/init.py", line 21, in <module> from rpy2.robjects.methods import RS4 File "/opt/python3/lib/python3.3/site-packages/rpy2/robjects/methods.py", line 5, in <module> from . import help as rhelp ImportError: cannot import name help from rpy2.robjects import help Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/opt/python3/lib/python3.3/site-packages/rpy2/robjects/init.py", line 21, in <module> from rpy2.robjects.methods import RS4 File "/opt/python3/lib/python3.3/site-packages/rpy2/robjects/methods.py", line 5, in <module> from . import help as rhelp ImportError: cannot import name help import rpy2.robjects.help Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/opt/python3/lib/python3.3/site-packages/rpy2/robjects/init.py", line 21, in <module> from rpy2.robjects.methods import RS4 File "/opt/python3/lib/python3.3/site-packages/rpy2/robjects/methods.py", line 5, in <module> from . import help as rhelp ImportError: cannot import name help

```If I comment "from rpy2.robjects import rhelp" in methods.py at least it imports ok. Might be some circular dep thing?

Comments (5)

  1. sphaero

    Just tried your latest commits and it's giving me the same errors.

    default branch:

    Python 3.3.0 (default, Jan  8 2013, 22:23:18) 
    [GCC 4.7.2] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import rpy2             
    >>> import rpy2.robjects
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/home/arnaud/python3/lib/python3.3/site-packages/rpy2/robjects/__init__.py", line 14, in <module>
        import rpy2.rinterface as rinterface
      File "/home/arnaud/python3/lib/python3.3/site-packages/rpy2/rinterface/__init__.py", line 24
        except ImportError, ie:
                          ^
    SyntaxError: invalid syntax
    

    Probably python2 syntax???

    latest 2.3.2 branch:

    Python 3.3.0 (default, Jan  8 2013, 22:23:18) 
    [GCC 4.7.2] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import rpy2
    >>> import rpy2.robjects
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/home/arnaud/python3/lib/python3.3/site-packages/rpy2/robjects/__init__.py", line 21, in <module>
        from rpy2.robjects.methods import RS4
      File "/home/arnaud/python3/lib/python3.3/site-packages/rpy2/robjects/methods.py", line 5, in <module>
        from . import help as rhelp
    ImportError: cannot import name help
    >>> 
    
  2. Laurent Gautier

    branch default: Odd that the syntax error was not triggered when I run tests here. Should be fixed with 1836:98cd5a2ac1a4

    branch version_2.3.x: That error is originating from possible circular dependencies. You are the first one to report this... may be worthwhile to rm -rf /home/arnaud/python3/lib/python3.3/site-packages/rpy2 and reinstall ?

  3. sphaero

    branch version_2.3.x: Nope, doesn't help. I reckon you are on OSX, it does seem to work on OSX. I also noticed the setup.py doesn't clean the build dir when running python3 setup.py clean --all. Don't know if it is related.

    branch default: seems fixed indeed but now getting:

    ~/python3/bin/python3.3
    Python 3.3.0 (default, Jan  8 2013, 22:23:18) 
    [GCC 4.7.2] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import rpy2.robjects
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/home/arnaud/python3/lib/python3.3/site-packages/rpy2/robjects/__init__.py", line 19, in <module>
        from rpy2.robjects.robject import RObjectMixin, RObject
      File "/home/arnaud/python3/lib/python3.3/site-packages/rpy2/robjects/robject.py", line 47
        print 'Unable to unlink tempfile %s' % tfname
                                           ^
    SyntaxError: invalid syntax
    

    Which is easily fixed by using 2to3. Then I get:

    >>> import rpy2.robjects
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/home/arnaud/python3/lib/python3.3/site-packages/rpy2/robjects/__init__.py", line 22, in <module>
        from rpy2.robjects.environments import Environment
      File "/home/arnaud/python3/lib/python3.3/site-packages/rpy2/robjects/environments.py", line 3, in <module>
        import conversion
    ImportError: No module named 'conversion'
    

    Now I run 2to3 over all files which leaves me with:

    >>> import rpy2.robjects
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/home/arnaud/python3/lib/python3.3/site-packages/rpy2/robjects/__init__.py", line 23, in <module>
        from rpy2.robjects.methods import RS4
      File "/home/arnaud/python3/lib/python3.3/site-packages/rpy2/robjects/methods.py", line 4, in <module>
        from rpy2.robjects import help as rhelp
    ImportError: cannot import name help
    

    So no luck yet...

  4. Laurent Gautier

    Bump. I have Python 3.3 and rpy2 from the branches 2.3.x and default working here.

    Did you solve the problem ?

  5. Log in to comment