I am trying to import the rpy2 library into a Jupyter Notebook but I cannot get past this error.
The PATH \'C:\\Program Files\\R\\R-4.0.2\\bin\\x64\' has been added.<
Here is my working solution:
import os os.environ["R_HOME"] = r"D:\Install\R\R-3.6.1" os.environ["PATH"] = r"D:\Install\R\R-3.6.1\bin\x64" + ";" + os.environ["PATH"] import rpy2 from rpy2.robjects import pandas2ri, packages pandas2ri.activate() stats = packages.importr('stats')