-
Notifications
You must be signed in to change notification settings - Fork 330
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
can't use rpy2 inside reticulate-embedded python #1638
Comments
Hi, thanks for reporting. I tried but can't reproduce locally. The > reticulate::import("rpy2.robjects")
/Users/tomasz/.virtualenvs/r-reticulate/lib/python3.10/site-packages/rpy2/rinterface_lib/embedded.py:276: UserWarning: R was initialized outside of rpy2 (R_NilValue != NULL). Trying to use it nevertheless.
warnings.warn(msg)
R was initialized outside of rpy2 (R_NilValue != NULL). Trying to use it nevertheless.
Module(rpy2.robjects) Do you perhaps have any custom |
No. From what I've gathered it seems to be windows issue and from your paths, I'd say you are running Linux? |
It seems the error is coming from here: https://github.com/wch/r-source/blob/b12ffba7584825d6b11bba8b7dbad084a74c1c20/src/main/memory.c#L1742 |
I'm not a Windows machine presently, but reading the source code, it seems that rpy2 is trying to initialize R when R is already initialized. It seems that That, calls Which leads to the error where the R symbol table is being attempted to be initialized twice. The stacktrace @dfalbel posted confirms that we have an It's not clear to me why rpy2 is attempting to initialize R. The other output from rpy2 indicates that some parts of rpy2 are correctly detecting that R is already initialized. A Python stacktrace from the |
@lgautier Do you know why rpy2 might be attempting to initialize R when running embedded under reticulate on Windows? |
Hi @lgautier / @t-kalinowski: is there any progress on this topic or any workaround? I'm running into the exact the same issue. Many thanks |
Describe the issue or bug and how to reproduce
This works in python console:
This fails in R console:
reticulate::import("rpy2.robjects")
The following message is infinitely printed
****found a symbol with attributes
Same issue, reported on rpy2 github:
rpy2/rpy2#942
Package versions
windows 10 64bit
R core : 4.3.0
reticulate: 1.38.0
rpy2: 3.5.16
python: 3.10.11
The text was updated successfully, but these errors were encountered: