1

I'm trying to run R in python through pyper, but I'm getting this OSError:

 r = pr.R(RCMD="/Library/Frameworks/R.framework/")
---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
<ipython-input-9-028f8367ac11> in <module>()
----> 1 r = pr.R(RCMD="/Library/Frameworks/R.framework/")

/Library/Python/2.7/site-packages/pyper.pyc in __init__(self, RCMD, max_len, use_numpy, use_pandas, use_dict, host, user, ssh, return_err, dump_stdout)
    598                 childstderr = file('nul', 'a')
    599 
--> 600         self.__dict__['prog'] = Popen(RCMD, stdin=PIPE, stdout=PIPE, stderr=return_err and _STDOUT or childstderr, startupinfo=info)
    601         self.__call__(self.Rfun)
    602 

/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.pyc in __init__(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags)
    708                                 p2cread, p2cwrite,
    709                                 c2pread, c2pwrite,
--> 710                                 errread, errwrite)
    711         except Exception:
    712             # Preserve original exception in case os.close raises.

/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.pyc in _execute_child(self, args, executable, preexec_fn, close_fds, cwd, env, universal_newlines, startupinfo, creationflags, shell, to_close, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite)
   1333                         raise
   1334                 child_exception = pickle.loads(data)
-> 1335                 raise child_exception
   1336 
   1337 

OSError: [Errno 13] Permission denied
ali_m
  • 71,714
  • 23
  • 223
  • 298
keybattle
  • 11
  • 1
  • Welcome to StackOverflow! `RCMD=` should either be the name of an R interpreter (e.g. `'R'`), or it should give the full path to an R executable. In your example it points to a directory instead. – ali_m Dec 29 '15 at 20:39
  • Hi ali_m, thanks for your quick respond. I'm not sure where my R interpreter is. There is a file called R in R.framework. But it does not work either. I went through usr/local/bin or usr/bin. I can not find it. – keybattle Dec 29 '15 at 20:54
  • I tried. I got an the following error message: OSError: [Errno 8] Exec format error – keybattle Dec 29 '15 at 20:57
  • ip-10-4-10-32:R.framework YajiRen$ file R R: Mach-O 64-bit dynamically linked shared library x86_64 ip-10-4-10-32:R.framework YajiRen$ uname -p i386 Is this what you are asking for? – keybattle Dec 29 '15 at 21:19
  • Also, I can not install rpy2 on my laptop. I got the error message: Error: Tried to guess R's HOME but no command (R) in the PATH. It seems that it can not find my R command as well – keybattle Dec 29 '15 at 21:21
  • I'm using 2015 macbook pro 15 with i7 processor. How come that my processor is 32 bit? – keybattle Dec 29 '15 at 21:35
  • ip-10-4-10-32:R.framework YajiRen$ uname -a Darwin ip-192-168-31-193.eu-west-1.compute.internal 15.0.0 Darwin Kernel Version 15.0.0: Sat Sep 19 15:53:46 PDT 2015; root:xnu-3247.10.11~1/RELEASE_X86_64 x86_64 – keybattle Dec 30 '15 at 02:50
  • OK, I take back my earlier comment - it looks as though `uname` is reporting the processor as i386 but the architecture as x86_64 (this seems to be weird OSX-related behavior). Could you update your question to include the fact that you can't actually run the R executable? You should mention the `Exec format error` and the outputs of `file /Library/Frameworks/R.framework/R` and `uname -a`. You can then delete your comments and I'll do the same for mine. – ali_m Dec 30 '15 at 14:11
  • Hi, Ali_m, I re-installed R and the problem is fixed. Thanks – keybattle Dec 30 '15 at 15:05

0 Answers0