在Windows中使用带有IBM COS的boto3库

问题描述 投票:0回答:2

你在这里提供python示例代码:https://ibm-public-cos.github.io/crs-docs/python

作为其中的一部分,Linux用户需要使用页面上显示的环境变量,或者在〜/ .aws中设置文件来保存aws键。

什么是Windows的模拟(假设这在Windows下工作)?

ibm-cloud cos ibm-cloud-storage
2个回答
0
投票

你可以尝试:

 > dir "%UserProfile%\.aws"

资料来源:https://docs.aws.amazon.com/cli/latest/userguide/cli-config-files.html

或者,如果您按照您提供的链接中的链接进入boto3 s3库,该库描述了用于设置凭据的环境变量:http://boto3.readthedocs.io/en/latest/guide/configuration.html


0
投票

如果您使用的是Windows,我建议使用以下两种方法之一:

1)安装Cygwin,这是在Windows环境中获取bash shell的最常用方法

2)在Windows机器上本机安装Ubuntu。从Windows 10开始,现在可以在Windows系统[1] [2]内本地运行Linux内核。这也称为“Windows上的Ubuntu上的Bash”。关于这一点,有一个非常cool talk with a demo

或者,您可以继续使用纯Windows环境,而不是set up environment variables in Windows用于Python应用程序。

[1] https://www.microsoft.com/en-us/store/p/ubuntu/9nblggh4msv6 [2] https://docs.microsoft.com/en-us/windows/wsl/about

© www.soinside.com 2019 - 2024. All rights reserved.