0

所以我使用 anaconda 来完成这一切,问题是当我尝试这样做时:

r = pyper.R(RCMD="D:/Apps/Anaconda/envs/rstudio/lib/R",use_pandas='True')

但随后出现错误:


PermissionError                           Traceback (most recent call last)
<ipython-input-28-31688287b0f4> in <module>
----> 1 runningR("Dataset/ml-latest-small/ratings.csv")

<ipython-input-27-0e85c3dea21c> in runningR(fileName)
      2 
      3     #Rのインスタンスを作る
----> 4     r = pyper.R(RCMD="D:/Apps/Anaconda/envs/rstudio/lib/R",use_pandas='True')
      5 
      6     #r.assign("fileName", fileName) #fileNameとし引数のfileNameを渡す

D:\Apps\Anaconda\lib\site-packages\pyper.py 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 

D:\Apps\Anaconda\lib\subprocess.py in __init__(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds, encoding, errors, text)
    767                                 c2pread, c2pwrite,
    768                                 errread, errwrite,
--> 769                                 restore_signals, start_new_session)
    770         except:
    771             # Cleanup if the child failed starting.

D:\Apps\Anaconda\lib\subprocess.py in _execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, unused_restore_signals, unused_start_new_session)
   1170                                          env,
   1171                                          os.fspath(cwd) if cwd is not None else None,
-> 1172                                          startupinfo)
   1173             finally:
   1174                 # Child is launched. Close the parent's copy of those pipe

PermissionError: [WinError 5] Access is denied
4

1 回答 1

0

似乎 R 需要管理员权限才能访问。但是,您要启动环境(IDE/Anaconda),右键单击并“以管理员身份运行”。

于 2019-04-11T22:39:42.270 回答