PermissionError: [Errno 13] 读取 csv 文件时权限被拒绝

时间:2021-07-10 21:00:31

标签: python pandas error-handling permission-denied

我正在尝试使用 Pandas 读取文件,但出现权限错误。我试过使用 chmod 和 chown 来更改权限设置,但这没有任何区别。这是代码,注释行是我尝试过的解决方案:-

import pandas as pd
import os 
#from os import stat
#from os import chmod


filepath = r"C:\Users\Vinayak Vaidyanathan\OneDrive\Documents\Visual Studio\Renewtech\raw\[IN-023C]\2018\2018-12\Inverter_1"
#os.chmod(filepath,777)
df = pd.read_csv(filepath) 
df

# print("Owner id of the file:", os.stat(filepath).st_uid)
# print("Group id of the file:", os.stat(filepath).st_gid) 

# uid = 3000
# gid = -1
# os.chown(filepath, uid, gid)
# print("\nOwner id of the file changed") ```

0 个答案:

没有答案
相关问题