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
Importing rpy2.robjects
fails with R>=4.2
#874
Comments
rpy2's test matrix has R-4.2.0 (for example, see https://github.com/rpy2/rpy2/runs/6141867886?check_suite_focus=true) and it appears that it installs and passes all automated tests. The error message observed might be caused by the R environment setup not telling the linker where to find the R shared library. The rpy2 tests suite ensures that this is the case: I am closing this as resolved. Reopen if the diagnosis is incorrect. |
Okay, I figured it out. In order for
Example here: https://github.com/scottgigante-immunai/scprep/runs/6241490722?check_suite_focus=true |
Comment in issue #874 suggests that v1 works but v2 does not.
@scottgigante-immunai I'm having a similar issue with rpy2, installed using conda, and rpy2 (see below). Can you provide a bit more detail perhaps on how you got this working? Thanks
|
@scottgigante-immunai Not sure I follow. Do you have rpy2 working with R 4.2? If so, what did you do in addition to the below?
|
I'm running on Github Actions, and in addition to the LD_LIBRARY_PATH step above, I used a different Python install ( |
@lgautier I could use your help to see how to resolve this issue. To get a reproducible example, please run the below. Sorry, the image is large.
JupyterLab will be available at the link below: You will see a popup with the message "JupyterLab Code Formatter Error". The issue linked below describes the problem with ryantam626/jupyterlab_code_formatter#258 In jupyterlab you can directly see the problem by using Note that we have been using
I would appreciate any guidance you can provide. Thanks -- Vincent |
@scottgigante-immunai - This might have been an issue with |
Upgrading to v2 of Python's setup on GHA. Issue #874 reported failure with v2, but it no longer seems the case.
@lgautier FYI The issue we are having with rpy2 is with Python 3.9.12 (conda) and R 4.2.0 installed from source. Both R and Python work fine. |
@lgautier can confirm this is fixed with v1, v2, v3, whether or not we set |
Similar issue: |
same here: from rpy2.robjects import help But I found it only in jupyter lab. With python script in the same env, it works fine.
|
@GegznaV The issue in stackoverflow you linked to seems very similar to the one I had. In my case, defining an environmental variable R_HOME to the home folder of the R installation seems to have worked. e.g. in PowerShell: A link that proved a bit helpful: https://rpy2.github.io/doc/v3.5.x/html/rinterface.html#module-rpy2.rinterface Specifically, the part about |
That did seem to stop the error Could this be related to R installed for system and things installed for user? e.g. AppData etc. |
In my case, I believe that it had to do with the R executable not having been added to my PATH environmental variable. Possibly because I did not allow it during installation of R, but I do not remember. So, if, for example, I open up a terminal and try to invoke an R executable, e.g. Rscript, it does not work, it cannot find it. And most probably the same goes for my rpy2 library, it failed to find the executable of R. and that is why I needed to provide it with the R_HOME variable. Of course, I do not know if this applies to your case as well. |
I still get the same error |
Actions for this link have expired and are no longer available. |
FWIW rpy2's own Actions use |
Describe the issue or bug
rpy2 cannot be imported if the R version is >=4.2
To Reproduce
Error
Additional context
Example Github Actions workflow reproducing the error is here: https://github.com/scottgigante-immunai/scprep/actions/runs/2229334197/workflow
The text was updated successfully, but these errors were encountered: