python 3.7.3, rpy2 3.2.0, the following code:
from rpy2 import robjects
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File ".virtualenvs/flask3/lib/python3.7/site-packages/rpy2/robjects/__init__.py", line 14, in <module>
import rpy2.rinterface as rinterface
File ".virtualenvs/flask3/lib/python3.7/site-packages/rpy2/rinterface.py", line 6, in <module>
from rpy2.rinterface_lib import openrlib
File ".virtualenvs/flask3/lib/python3.7/site-packages/rpy2/rinterface_lib/openrlib.py", line 65, in <module>
_get_dataptr_fallback)
File ".virtualenvs/flask3/lib/python3.7/site-packages/rpy2/rinterface_lib/openrlib.py", line 50, in _get_symbol_or_fallback
res = getattr(rlib, symbol)
RuntimeError: found a situation in which we try to build a type recursively. This is known to occur e.g. in ``struct s { void(*callable)(struct s); }''. Please report if you get this error and really need support for your case.
What's going on? This looks like standard procedure for rypy2, and indeed how we used it under python 2.
Same issue applies for any kind of rpy2 import: import rpy2.robjects.tests
etc.
I ran into the same problem and found the same issue @ejolly linked above. To get around it, I downgraded my cffi
library from 1.13.0
to 1.12.3
.
pip install cffi==1.12.3
Worked like a charm.
edit:cffi
1.13.1 is released. Just update it and all should work.
The issue appeared with cffi
1.13.0, but appears limited to the ABI mode.
rpy2
will try to use the API mode, but if it fails will silently fall back to the ABI mode. If your system can be configured to have a C compiler, the API mode should be installed. To force the use of the API mode, set the environment variable:
RPY2_CFFI_MODE=API
(see info box in the doc: https://rpy2.github.io/doc/v3.2.x/html/overview.html#install-from-source)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With