我希望将文件上传到Google云端存储。我创建了一个服务帐户,将p12文件转换为pem文件,然后在我的驱动程序中引用了服务帐户电子邮件地址和pem文件:
from libcloud.storage.types import Provider
from libcloud.storage.providers import get_driver
CloudStorage = get_driver(Provider.GOOGLE_STORAGE)
driver = CloudStorage(
'...@developer.gserviceaccount.com',
os.path.expanduser('~/.ssh/my.pem'),
project='my_project',
)
然而,当我做
时driver.list_containers()
我得到了
<?xml version='1.0' encoding='UTF-8'?><Error><Code>InvalidSecurity</Code><Message>The provided security credentials are not valid.</Message><Details>Incorrect Authorization header</Details></Error>