Error in robjects.__init__.py on line 261 due to ... itertools.izip(...)? - python 3.3.3 -

Issue #238 resolved
Evaristo Caraballo created an issue

Hi,

Tried to run the following in ipython3 for python 3.3.3:

print(rpy2.robjects.r)

(as suggested at sourceforge.net/rpy2/doc-2.4/html/robjects_rinstance.html)

Got the following error:


(...)
/$HOME$/lib/python3.3/site-packages/rpy2/robjects/__init__.py in __str__(self)
    259         s += os.linesep
    260         version = self["version"]
**--> 261         tmp = [n+': '+val[0] for n, val in itertools.izip(version.names, version)]**
    262         s += str.join(os.linesep, tmp)
    263         return s

**AttributeError: 'module' object has no attribute 'izip'**

I substituted the line 261 temporarily by:

         if sys.version_info[0] < 3:
            tmp = [n+': '+val[0] for n, val in itertools.izip(version.names, version)]
        else:
            tmp = [n+': '+val[0] for n, val in zip(version.names, version)]

Tested and apparently worked fine for my version. NO TEST was done for previous versions, though. Hope this helps,

Regards,

Evaristo

Comments (7)

  1. Log in to comment