简体   繁体   English

错误 13 权限被拒绝:

[英]Errno 13 Permission denied:

I want to upload a mp4 file from my pc to my google cloud bucket but i get an error [Errno 13] Permission denied: 'E:\\\\Coding\\\\Videos'我想将 mp4 文件从我的电脑上传到我的谷歌云存储桶,但出现错误[Errno 13] Permission denied: 'E:\\\\Coding\\\\Videos'

I Would be happy is anyone could help me with this problem.我很高兴有人可以帮助我解决这个问题。 Here is the code btw这是代码顺便说一句

        def upload_to_bucket(blob_name, file_path, bucket_name):
            try:
                bucket = yclient.get_bucket(bucket_name)
                blob = bucket.blob(blob_name)
                f = open('E:\Coding\Videos')
                blob.upload_from_filename(file_path)
                return True
            except Exception as e:
                print(e)
                return False


        file_path = r'E:\Coding\Videos'
        upload_to_bucket('videot', os.path.join(file_path, videot), 'audios-for-pychromecast')
        upload_to_bucket('videosfrocc/videot', os.path.join(file_path, videot), 'audios-for-pychromecast')```

It seems you're trying to open a directory?您似乎正在尝试open目录? That will probably not work, you'd have to go through all files manually.这可能不起作用,您必须手动浏览所有文件。 But you're also not then using the file handle that you opened, so you might want to get rid of that entirely.但是您也没有使用您打开的文件句柄,因此您可能希望完全摆脱它。

What does upload_from_filename look like? upload_from_filename什么样的? Is that from a library?是图书馆的吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM