import rpy2.robjects as ro
from rpy2.robjects.packages import importr
from rpy2.robjects import pandas2ri
It raises an error:
ValueError: r_home is None. Try python -m rpy2.situation
I tried googleing but I don't find an answer. I use Linux and python3
Thank you for your help
Use the following code before importing rpy2:
import os
os.environ['R_HOME'] = "C:\Program Files\R\R-3.6.1" #or whereever your R is installed
This works for me (but only temporarily)