0

I can't run the wonderful PypeR (r to python interface) anymore. I can import it, but as I try to run it it crashes.

I suspect it is because I installed El Capitan OSX.

I tried to install update pypeR with no success.

when I run it with:

e.g.

r = R()

that's the error that I get.

Traceback (most recent call last):
  File "<pyshell#3>", line 1, in <module>
    a = R()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pyper.py", line 600, in __init__
    self.__dict__['prog'] = Popen(RCMD, stdin=PIPE, stdout=PIPE, stderr=return_err and _STDOUT or childstderr, startupinfo=info)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 710, in __init__
    errread, errwrite)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1335, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

does anyone have a clue on how to solve this problem?


update:

if I run it from a shell instead of Idle it works. I really can't see why.

Python's version is exactly the same, built at the same time.

ali_m
  • 71,714
  • 23
  • 223
  • 298
DaniPaniz
  • 1,058
  • 2
  • 13
  • 24

1 Answers1

3

It looks like PypeR cannot find R to run. Most likely the R command is not in the search path for command ($PATH) when you are using idle. One way is to explicitly point out which R command to use, e.g., if the R command is located in /usr/local/bin, you may use

r = R(RCMD="/usr/local/bin/R")

Of course, it is best if you can add R's path for idle environment.

Mogsdad
  • 44,709
  • 21
  • 151
  • 275
Xiao-Qin
  • 46
  • 2
  • hey @Xiao-Qin I'm on a computer where pyper doesn't even run from shell, but only if I specify the path as you wrote above. Is there any way to change the sys path so that it finds automatically? what is the command ($PATH) you are referring to? I tried to modify the sys.path by adding the path to R, but it doesn't work :/ thanks in advance! – DaniPaniz Apr 09 '19 at 13:56