-1

I have an error when running the following in python

Runtime error Traceback (most recent call last): File "", line 6, in File "C:\Python27\ArcGIS10.3\Lib\rpy2\robjects__init__.py", line 55, in conversion.ri2py = default_ri2py NameError: name 'conversion' is not defined

this is my script init.py

import rpy2.rinterface as rinterface
import rpy2.rlike.container as rlc
import rpy2.robjects.conversion

conversion.ri2py = default_ri2py
1
  • NameError: name 'conversion' is not defined means that python cannot find the variable you are talking about. Your code does not define conversion at any point. Did you perhaps forget to append as conversion after import rpy2.robjects.conversion? Aug 7, 2016 at 0:55

1 Answer 1

0

Variable simply not defined. Use the snippet below to define it.

import rpy2.robjects as robjects

robjects.conversion.ri2py = default_ri2py

http://rpy.sourceforge.net/rpy2/doc-2.1/html/robjects_convert.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.