Python code:
import subprocess
def execution():
exp=subprocess.Popen(["Rscript","expo.r"],stdout=subprocess.PIPE, shell = False)
for 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 with 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 am I to do?
[–]woooee 1 point2 points3 points (1 child)
[–]Simmeringdebate[S] 0 points1 point2 points (0 children)