PermissionError: [errno 13] 在 Windows 10 中运行 python 脚本时权限被拒绝

问题描述

当我运行 python 脚本从 Firebase 存储下载图像时,我收到以下错误“PermissionError: [Errno 13] Permission denied:”。我试过以管理员身份运行但没有成功,还检查了权限,它出现在我的设置中我有完全的读写权限,所以我不知道该怎么办?

这是我正在运行的代码:

import os 
from google.cloud import storage
os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = 'C:/Users/username/Documents/NNFILES/credential_file.json'
storage_client = storage.Client()
bucket = storage_client.get_bucket('project.appspot.com')
imageBlob = bucket.blob("/")
imagePath1 = "C:\\Users\\username\\Downloads"
Blob = bucket.blob('result_5.png')
Blob.download_to_filename(imagePath1)
Blob.download_as_string()

还要补充一点,我已成功上传到 Firebase 存储,因此我认为这不是 .json 文件或 Firebase 的问题。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)