os.access(os.getcwd(),os.W_OK | os.X_OK)但权限被拒绝

时间:2019-06-11 14:43:31

标签: python jupyter-notebook

我正在将ipynb的csv文件写入

的文件夹中

pd.DataFrame(data.Event.unique()).to_csv(os.getcwd())

我已使用

检查我的写访问权限
os.access(os.getcwd(), os.W_OK|os.X_OK)

返回True和 尝试将Jupyter作为行政管理人员 但是我仍然出错。

!(https://imgur.com/a/qKUXqRZ

这是堆栈跟踪

---------------------------------------------------------------------------
PermissionError                           Traceback (most recent call last)
<ipython-input-152-7489dfffa317> in <module>
----> 1 pd.DataFrame(data.Event.unique()).to_csv(os.getcwd())

~\Anaconda3\lib\site-packages\pandas\core\frame.py in to_csv(self, path_or_buf, sep, na_rep, float_format, columns, header, index, index_label, mode, encoding, compression, quoting, quotechar, line_terminator, chunksize, tupleize_cols, date_format, doublequote, escapechar, decimal)
   1743                                  doublequote=doublequote,
   1744                                  escapechar=escapechar, decimal=decimal)
-> 1745         formatter.save()
   1746 
   1747         if path_or_buf is None:

~\Anaconda3\lib\site-packages\pandas\io\formats\csvs.py in save(self)
    154             f, handles = _get_handle(self.path_or_buf, self.mode,
    155                                      encoding=encoding,
--> 156                                      compression=self.compression)
    157             close = True
    158 

~\Anaconda3\lib\site-packages\pandas\io\common.py in _get_handle(path_or_buf, mode, encoding, compression, memory_map, is_text)
    398         elif encoding:
    399             # Python 3 and encoding
--> 400             f = open(path_or_buf, mode, encoding=encoding)
    401         elif is_text:
    402             # Python 3 and no explicit encoding

PermissionError: [Errno 13] Permission denied: 'C:\\Users\\Dell\\Desktop\\ecom\\Product\\POD\\New folder\\News'

0 个答案:

没有答案