我无法通过 Rundeck 运行 AWS CLI 命令,从终端一切正常,安装了 boto3,也安装了 botocore
import sys
import os
if os.environ.get('LC_CTYPE', '') == 'UTF-8':
os.environ['LC_CTYPE'] = 'en_US.UTF-8'
import awscli.clidriver
def main():
return awscli.clidriver.main()
if __name__ == '__main__':
sys.exit(main())
这就是我在 Rundeck UI 上得到的
Traceback (most recent call last):
File "/bin/aws", line 19, in <module>
import awscli.clidriver
File "/usr/lib/python2.7/site-packages/awscli/clidriver.py", line 17, in <module>
import botocore.session
ImportError: No module named botocore.session
答案1
设法摆脱错误
pip install awscli --force-reinstall --upgrade
然后从 rundeck 界面(命令选项卡):
aws configure set aws_access_key_id default_access_key
aws configure set aws_secret_access_key default_secret_key
aws configure set default.region us-west-2