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

时间:2018-02-21 20:30:48

标签: ibm-cloud cos ibm-cloud-storage

您在此处提供了python示例代码:https://ibm-public-cos.github.io/crs-docs/python

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

Windows的模拟是什么(假设这可以在Windows下运行)?

2 个答案:

答案 0 :(得分: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

答案 1 :(得分:0)

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

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

2)在Windows机器上本机安装Ubuntu。从Windows 10开始,现在可以本机运行Linux内核,内部 Windows系统[1] [2]。这也称为“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