Pyper error: [WinError 2] The system cannot find the file specified

614 Views Asked by At

I'm trying to work with the pyper library in Python. I've been following along with the example here, but I keep running into an error. It doesn't seem like the pyper library is working for me at all.

import pandas as pd
import pyper as pr

r = pr.R(use_pandas = True)

I get the following error: [WinError 2] The system cannot find the file specified

I'm running it in a Juypter environment on Python 3. Not sure if that makes a difference.

1

There are 1 best solutions below

0
On BEST ANSWER

I have tested this, and I am sure it is related to your R installation and if your python kernel can find the R executable.
Make sure R is installed, and your system path variable contains the directory for the R binaries ("C:\Program Files\R\R-4.1.0\bin", if you are using the latest version).
You can set this with a GUI in windows running "SystemPropertiesAdvanced" from the command prompt > Environment Variables > And edit the Path variable within the System Variables to include the R bin directory. However it required a full PC restart for me to work in the Jupyter Notebook.