python - Subprocess with Rscript error -
python code:
import subprocess def execution(): exp=subprocess.popen(["rscript","expo.r"],stdout=subprocess.pipe, shell = false) line in exp.stdout.readlines(): line = line.strip() return(line) execution()
my r script runs fine
however sublime text throws back:
traceback (most recent call last): file "/users/user/desktop/work/7-26-17/pyc.py", line 7, in <module> execution() file "/users/user/desktop/work/7-26-17/pyc.py", line 3, in execution exp=subprocess.popen(["rscript","expo.r"],stdout=subprocess.pipe, shell = false) file "/library/frameworks/python.framework/versions/3.6/lib/python3.6/subprocess.py", line 707, in __init__ restore_signals, start_new_session) file "/library/frameworks/python.framework/versions/3.6/lib/python3.6/subprocess.py", line 1326, in _execute_child raise child_exception_type(errno_num, err_msg) filenotfounderror: [errno 2] no such file or directory: 'rscript' [finished in 0.1s exit code 1] [cmd: ['/library/frameworks/python.framework/versions/3.6/bin/python3', '-u', '/users/user/desktop/work/7-26-17/pyc.py']] [dir: /users/user/desktop/work/7-26-17] [path: /usr/bin:/bin:/usr/sbin:/sbin]
what do? have uninstalled , reinstalled r have searched online find solution cannot use rpy2. need run on heroku.
Comments
Post a Comment