'importing rpy2.objects gives error: unable to initialize the JiT
I am trying to incorporate some R code in the python environment. I imported rpy2 package successfully. However, I get the error when I try to import rpy2.objects
from rpy2.robjects import pandas2ri
I get the below error
Error in glue(.Internal(R.home()), "library", "base", "R", "base", sep =
.Platform$file.sep) :
4 arguments passed to .Internal(paste) which requires 3
Error: could not find function "attach"
Error: object '.ArgsEnv' not found
Fatal error: unable to initialize the JIT
Restarting kernel...
I found some of the related questions in SE here here and here. But, none of them seem to work.
Solution 1:[1]
Form what I've gathered: if you have R installed on your machine it will avtomatically use the system's installation of R instead of the version rpy2 requires. To omit that I just added
import os
os.environ['R_HOME'] = '/Users/<your user>/anaconda3/envs/<env name>/lib/R'
before I imported anything from rpy2. If it doesn't work, you may have to uninstall R from your machine completely.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | maksobelser |
