如何修复“ [WinError 5]访问被拒绝”

时间:2019-04-11 21:36:48

标签: python windows anaconda permission-denied pyper

所以我将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

1 个答案:

答案 0 :(得分:0)

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